Bug 1109388 - Delay reading data. r=jryans
authorJennifer Fong <jen@ednapiranha.com>
Wed, 11 Feb 2015 08:35:00 +0100
changeset 228883 e0f02f382772e3bcd23a0f83446cf2ba894d1928
parent 228882 4cafbb821d67fdd396d2c49527a2d5b45c965b9b
child 228884 a76b4f207fa7d4ca921297c1062900a478647ecd
push id28273
push userryanvm@gmail.com
push dateThu, 12 Feb 2015 23:03:43 +0000
treeherdermozilla-central@2f5c5ec1a24b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1109388
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1109388 - Delay reading data. r=jryans
browser/devtools/webide/content/devicepreferences.js
browser/devtools/webide/content/devicesettings.js
browser/devtools/webide/content/permissionstable.js
browser/devtools/webide/content/runtimedetails.js
browser/devtools/webide/content/webide.xul
browser/devtools/webide/modules/config-view.js
browser/devtools/webide/test/chrome.ini
browser/devtools/webide/test/device_front_shared.js
browser/devtools/webide/test/head.js
browser/devtools/webide/test/test_device_permissions.html
browser/devtools/webide/test/test_device_preferences.html
browser/devtools/webide/test/test_device_runtime.html
browser/devtools/webide/test/test_device_settings.html
browser/devtools/webide/test/test_deviceinfo.html
--- a/browser/devtools/webide/content/devicepreferences.js
+++ b/browser/devtools/webide/content/devicepreferences.js
@@ -1,15 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Cu = Components.utils;
 const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
-const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm");
 const {AppManager} = require("devtools/webide/app-manager");
 const {Connection} = require("devtools/client/connection-manager");
 const ConfigView = require("devtools/webide/config-view");
 
 let configView = new ConfigView(window);
 
 window.addEventListener("load", function onLoad() {
   window.removeEventListener("load", onLoad);
@@ -69,22 +68,14 @@ function BuildUI() {
 
   if (AppManager.connection &&
       AppManager.connection.status == Connection.Status.CONNECTED &&
       AppManager.preferenceFront) {
     configView.front = AppManager.preferenceFront;
     configView.kind = "Pref";
     configView.includeTypeName = true;
 
-    getAllPrefs = AppManager.preferenceFront.getAllPrefs();
-    getAllPrefs.then(json => {
-      let deviceItems = Object.keys(json);
-      deviceItems.sort();
-      configView.keys = deviceItems;
-      for (let i = 0; i < configView.keys.length; i++) {
-        let key = configView.keys[i];
-        configView.generateField(key, json[key].value, json[key].hasUserValue);
-      }
-    });
+    getAllPrefs = AppManager.preferenceFront.getAllPrefs()
+                  .then(json => configView.generateDisplay(json));
   } else {
     CloseUI();
   }
 }
--- a/browser/devtools/webide/content/devicesettings.js
+++ b/browser/devtools/webide/content/devicesettings.js
@@ -1,15 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Cu = Components.utils;
 const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
-const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm");
 const {AppManager} = require("devtools/webide/app-manager");
 const {Connection} = require("devtools/client/connection-manager");
 const ConfigView = require("devtools/webide/config-view");
 
 let configView = new ConfigView(window);
 
 window.addEventListener("load", function onLoad() {
   window.removeEventListener("load", onLoad);
@@ -70,21 +69,13 @@ function BuildUI() {
   if (AppManager.connection &&
       AppManager.connection.status == Connection.Status.CONNECTED &&
       AppManager.settingsFront) {
     configView.front = AppManager.settingsFront;
     configView.kind = "Setting";
     configView.includeTypeName = false;
 
     getAllSettings = AppManager.settingsFront.getAllSettings()
-    getAllSettings.then(json => {
-      let deviceItems = Object.keys(json);
-      deviceItems.sort();
-      configView.keys = deviceItems;
-      for (let i = 0; i < configView.keys.length; i++) {
-        let key = configView.keys[i];
-        configView.generateField(key, json[key].value, json[key].hasUserValue);
-      }
-    });
+                     .then(json => configView.generateDisplay(json));
   } else {
     CloseUI();
   }
 }
--- a/browser/devtools/webide/content/permissionstable.js
+++ b/browser/devtools/webide/content/permissionstable.js
@@ -25,51 +25,54 @@ function CloseUI() {
 }
 
 function OnAppManagerUpdate(event, what) {
   if (what == "connection" || what == "list-tabs-response") {
     BuildUI();
   }
 }
 
+function generateFields(json) {
+  let table = document.querySelector("table");
+  let permissionsTable = json.rawPermissionsTable;
+  for (let name in permissionsTable) {
+    let tr = document.createElement("tr");
+    tr.className = "line";
+    let td = document.createElement("td");
+    td.textContent = name;
+    tr.appendChild(td);
+    for (let type of ["app","privileged","certified"]) {
+      let td = document.createElement("td");
+      if (permissionsTable[name][type] == json.ALLOW_ACTION) {
+        td.textContent = "✓";
+        td.className = "permallow";
+      }
+      if (permissionsTable[name][type] == json.PROMPT_ACTION) {
+        td.textContent = "!";
+        td.className = "permprompt";
+      }
+      if (permissionsTable[name][type] == json.DENY_ACTION) {
+        td.textContent = "✕";
+        td.className = "permdeny"
+      }
+      tr.appendChild(td);
+    }
+    table.appendChild(tr);
+  }
+}
+
 let getRawPermissionsTablePromise; // Used by tests
 function BuildUI() {
   let table = document.querySelector("table");
   let lines = table.querySelectorAll(".line");
   for (let line of lines) {
     line.remove();
   }
 
   if (AppManager.connection &&
       AppManager.connection.status == Connection.Status.CONNECTED &&
       AppManager.deviceFront) {
-    getRawPermissionsTablePromise = AppManager.deviceFront.getRawPermissionsTable();
-    getRawPermissionsTablePromise.then(json => {
-      let permissionsTable = json.rawPermissionsTable;
-      for (let name in permissionsTable) {
-        let tr = document.createElement("tr");
-        tr.className = "line";
-        let td = document.createElement("td");
-        td.textContent = name;
-        tr.appendChild(td);
-        for (let type of ["app","privileged","certified"]) {
-          let td = document.createElement("td");
-          if (permissionsTable[name][type] == json.ALLOW_ACTION) {
-            td.textContent = "✓";
-            td.className = "permallow";
-          }
-          if (permissionsTable[name][type] == json.PROMPT_ACTION) {
-            td.textContent = "!";
-            td.className = "permprompt";
-          }
-          if (permissionsTable[name][type] == json.DENY_ACTION) {
-            td.textContent = "✕";
-            td.className = "permdeny"
-          }
-          tr.appendChild(td);
-        }
-        table.appendChild(tr);
-      }
-    });
+    getRawPermissionsTablePromise = AppManager.deviceFront.getRawPermissionsTable()
+                                    .then(json => generateFields(json));
   } else {
     CloseUI();
   }
 }
--- a/browser/devtools/webide/content/runtimedetails.js
+++ b/browser/devtools/webide/content/runtimedetails.js
@@ -36,36 +36,39 @@ function CloseUI() {
 
 function OnAppManagerUpdate(event, what) {
   if (what == "connection" || what == "list-tabs-response") {
     BuildUI();
     CheckLockState();
   }
 }
 
+function generateFields(json) {
+  let table = document.querySelector("table");
+  for (let name in json) {
+    let tr = document.createElement("tr");
+    let td = document.createElement("td");
+    td.textContent = name;
+    tr.appendChild(td);
+    td = document.createElement("td");
+    td.textContent = json[name];
+    tr.appendChild(td);
+    table.appendChild(tr);
+  };
+}
+
 let getDescriptionPromise; // Used by tests
 function BuildUI() {
   let table = document.querySelector("table");
   table.innerHTML = "";
   if (AppManager.connection &&
       AppManager.connection.status == Connection.Status.CONNECTED &&
       AppManager.deviceFront) {
-    getDescriptionPromise = AppManager.deviceFront.getDescription();
-    getDescriptionPromise.then(json => {
-      for (let name in json) {
-        let tr = document.createElement("tr");
-        let td = document.createElement("td");
-        td.textContent = name;
-        tr.appendChild(td);
-        td = document.createElement("td");
-        td.textContent = json[name];
-        tr.appendChild(td);
-        table.appendChild(tr);
-      }
-    });
+    getDescriptionPromise = AppManager.deviceFront.getDescription()
+                            .then(json => generateFields(json));
   } else {
     CloseUI();
   }
 }
 
 function CheckLockState() {
   let adbCheckResult = document.querySelector("#adb-check > .yesno");
   let devtoolsCheckResult = document.querySelector("#devtools-check > .yesno");
--- a/browser/devtools/webide/content/webide.xul
+++ b/browser/devtools/webide/content/webide.xul
@@ -191,20 +191,20 @@
   </popupset>
 
   <notificationbox flex="1" id="notificationbox">
     <deck flex="1" id="deck" selectedIndex="-1">
       <iframe id="deck-panel-details" flex="1" src="details.xhtml"/>
       <iframe id="deck-panel-projecteditor" flex="1"/>
       <iframe id="deck-panel-addons" flex="1" src="addons.xhtml"/>
       <iframe id="deck-panel-prefs" flex="1" src="prefs.xhtml"/>
-      <iframe id="deck-panel-permissionstable" flex="1" src="permissionstable.xhtml"/>
-      <iframe id="deck-panel-runtimedetails" flex="1" src="runtimedetails.xhtml"/>
+      <iframe id="deck-panel-permissionstable" flex="1" lazysrc="permissionstable.xhtml"/>
+      <iframe id="deck-panel-runtimedetails" flex="1" lazysrc="runtimedetails.xhtml"/>
       <iframe id="deck-panel-monitor" flex="1" lazysrc="monitor.xhtml"/>
-      <iframe id="deck-panel-devicepreferences" flex="1" src="devicepreferences.xhtml"/>
-      <iframe id="deck-panel-devicesettings" flex="1" src="devicesettings.xhtml"/>
+      <iframe id="deck-panel-devicepreferences" flex="1" lazysrc="devicepreferences.xhtml"/>
+      <iframe id="deck-panel-devicesettings" flex="1" lazysrc="devicesettings.xhtml"/>
     </deck>
     <splitter hidden="true" class="devtools-horizontal-splitter" orient="vertical"/>
     <!-- toolbox iframe will be inserted here -->
   </notificationbox>
 
 
 </window>
--- a/browser/devtools/webide/modules/config-view.js
+++ b/browser/devtools/webide/modules/config-view.js
@@ -80,16 +80,26 @@ ConfigView.prototype = {
       var trs = this._doc.getElementById("device-fields").querySelectorAll("tr");
 
       for (let i = 0; i < trs.length; i++) {
         trs[i].classList.remove("hide");
       }
     }
   },
 
+  generateDisplay: function(json) {
+    let deviceItems = Object.keys(json);
+    deviceItems.sort();
+    this.keys = deviceItems;
+    for (let i = 0; i < this.keys.length; i++) {
+      let key = this.keys[i];
+      this.generateField(key, json[key].value, json[key].hasUserValue);
+    }
+  },
+
   generateField: function(name, value, hasUserValue, customType, newRow) {
     let table = this._doc.querySelector("table");
     let sResetDefault = Strings.GetStringFromName("device_reset_default");
 
     if (this._keys.indexOf(name) === -1) {
       this._keys.push(name);
     }
 
@@ -110,16 +120,20 @@ ConfigView.prototype = {
       input.checked = value;
     } else {
       if (typeof value === "object") {
         value = JSON.stringify(value);
       }
       input.value = value;
     }
 
+    if (!(this._includeTypeName || isNaN(parseInt(value, 10)))) {
+      input.type = "number";
+    }
+
     td.appendChild(input);
     tr.appendChild(td);
     td = this._doc.createElement("td");
     td.setAttribute("id", "td-" + name);
 
     let button = this._doc.createElement("button");
     button.setAttribute("data-id", name);
     button.setAttribute("id", "btn-" + name);
--- a/browser/devtools/webide/test/chrome.ini
+++ b/browser/devtools/webide/test/chrome.ini
@@ -39,16 +39,17 @@ support-files =
 
 [test_basic.html]
 [test_newapp.html]
 [test_import.html]
 [test_duplicate_import.html]
 [test_runtime.html]
 [test_manifestUpdate.html]
 [test_addons.html]
-[test_deviceinfo.html]
+[test_device_runtime.html]
+[test_device_permissions.html]
 [test_autoconnect_runtime.html]
 [test_telemetry.html]
 [test_device_preferences.html]
 [test_device_settings.html]
 [test_fullscreenToolbox.html]
 [test_zoom.html]
 [test_build.html]
--- a/browser/devtools/webide/test/device_front_shared.js
+++ b/browser/devtools/webide/test/device_front_shared.js
@@ -128,17 +128,17 @@ let editFieldInteger = Task.async(functi
     }
     ok(!found, "Custom field removed");
   }
 });
 
 let resetExistingField = Task.async(function*(id) {
   let existing = doc.getElementById(id);
   existing.click();
-  is(existing.checked, false, "Existing boolean value is correct");
+  is(existing.checked, true, "Existing boolean value is correct");
   resetBtn = doc.getElementById("btn-" + id);
   resetBtn.click();
 
   yield iframe.contentWindow.configView._defaultField;
 
   ok(resetBtn.classList.contains("hide"), true, "Reset button hidden");
   is(existing.checked, true, "Existing field reset");
 });
--- a/browser/devtools/webide/test/head.js
+++ b/browser/devtools/webide/test/head.js
@@ -132,16 +132,25 @@ function documentIsLoaded(doc) {
         doc.removeEventListener("readystatechange", onChange);
         deferred.resolve();
       }
     });
   }
   return deferred.promise;
 }
 
+function lazyIframeIsLoaded(iframe) {
+  let deferred = promise.defer();
+  iframe.addEventListener("load", function onLoad() {
+    iframe.removeEventListener("load", onLoad, true);
+    deferred.resolve();
+  }, true);
+  return deferred.promise;
+}
+
 function addTab(aUrl, aWindow) {
   info("Adding tab: " + aUrl);
 
   let deferred = promise.defer();
   let targetWindow = aWindow || window;
   let targetBrowser = targetWindow.gBrowser;
 
   targetWindow.focus();
new file mode 100644
--- /dev/null
+++ b/browser/devtools/webide/test/test_device_permissions.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+
+<html>
+
+  <head>
+    <meta charset="utf8">
+    <title></title>
+
+    <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+    <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
+    <script type="application/javascript;version=1.8" src="head.js"></script>
+    <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+  </head>
+
+  <body>
+
+    <script type="application/javascript;version=1.8">
+      window.onload = function() {
+        SimpleTest.waitForExplicitFinish();
+
+        Task.spawn(function* () {
+          Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
+
+          if (!DebuggerServer.initialized) {
+            DebuggerServer.init();
+            DebuggerServer.addBrowserActors();
+          }
+
+          let win = yield openWebIDE();
+
+          let permIframe = win.document.querySelector("#deck-panel-permissionstable");
+
+          yield connectToLocalRuntime(win);
+
+          let perm = win.document.querySelector("#cmd_showPermissionsTable");
+
+          ok(!perm.hasAttribute("disabled"), "perm cmd enabled");
+
+          let deck = win.document.querySelector("#deck");
+
+          win.Cmds.showPermissionsTable();
+          is(deck.selectedPanel, permIframe, "permission iframe selected");
+
+          yield nextTick();
+
+          yield lazyIframeIsLoaded(permIframe);
+
+          yield nextTick();
+
+          yield permIframe.contentWindow.getRawPermissionsTablePromise;
+
+          doc = permIframe.contentWindow.document;
+          trs = doc.querySelectorAll(".line");
+          found = false;
+          for (let tr of trs) {
+            let [name,v1,v2,v3] = tr.querySelectorAll("td");
+            if (name.textContent == "geolocation") {
+              found = true;
+              is(v1.className, "permprompt", "geolocation perm is valid");
+              is(v2.className, "permprompt", "geolocation perm is valid");
+              is(v3.className, "permprompt", "geolocation perm is valid");
+              break;
+            }
+          }
+          ok(found, "Found geolocation line");
+
+          doc.querySelector("#close").click();
+
+          ok(!deck.selectedPanel, "No panel selected");
+
+          DebuggerServer.destroy();
+
+          yield closeWebIDE(win);
+
+          SimpleTest.finish();
+        }).then(null, e => {
+          ok(false, "Exception: " + e);
+          SimpleTest.finish();
+        });
+      }
+    </script>
+  </body>
+</html>
--- a/browser/devtools/webide/test/test_device_preferences.html
+++ b/browser/devtools/webide/test/test_device_preferences.html
@@ -25,45 +25,47 @@
             DebuggerServer.init();
             DebuggerServer.addBrowserActors();
           }
 
           let win = yield openWebIDE();
 
           let prefIframe = win.document.querySelector("#deck-panel-devicepreferences");
 
-          yield documentIsLoaded(prefIframe.contentWindow.document);
-
           win.AppManager.update("runtimelist");
 
           yield connectToLocalRuntime(win);
 
-          yield nextTick();
-
           let prefs = win.document.querySelector("#cmd_showDevicePrefs");
 
           ok(!prefs.hasAttribute("disabled"), "device prefs cmd enabled");
 
           let deck = win.document.querySelector("#deck");
 
           win.Cmds.showDevicePrefs();
           is(deck.selectedPanel, prefIframe, "device preferences iframe selected");
 
+          yield nextTick();
+
+          yield lazyIframeIsLoaded(prefIframe);
+
+          yield nextTick();
+
           yield prefIframe.contentWindow.getAllPrefs;
-          yield nextTick();
 
           setDocument(prefIframe);
 
           let fields = doc.querySelectorAll(".editable");
-          let preference = "accessibility.blockautorefresh";
+
+          addNewField();
+
+          let preference = "accessibility.accesskeycausesactivation";
 
           fieldChange(fields, preference);
 
-          addNewField();
-
           addNewFieldWithEnter();
 
           editExistingField();
 
           addNewFieldInteger();
 
           yield editFieldInteger();
 
new file mode 100644
--- /dev/null
+++ b/browser/devtools/webide/test/test_device_runtime.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+
+<html>
+
+  <head>
+    <meta charset="utf8">
+    <title></title>
+
+    <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+    <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
+    <script type="application/javascript;version=1.8" src="head.js"></script>
+    <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+  </head>
+
+  <body>
+
+    <script type="application/javascript;version=1.8">
+      window.onload = function() {
+        SimpleTest.waitForExplicitFinish();
+
+        Task.spawn(function* () {
+          Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
+
+          if (!DebuggerServer.initialized) {
+            DebuggerServer.init();
+            DebuggerServer.addBrowserActors();
+          }
+
+          let win = yield openWebIDE();
+
+          let detailsIframe = win.document.querySelector("#deck-panel-runtimedetails");
+
+          yield connectToLocalRuntime(win);
+
+          let details = win.document.querySelector("#cmd_showRuntimeDetails");
+
+          ok(!details.hasAttribute("disabled"), "info cmd enabled");
+
+          let deck = win.document.querySelector("#deck");
+
+          win.Cmds.showRuntimeDetails();
+          is(deck.selectedPanel, detailsIframe, "info iframe selected");
+
+          yield nextTick();
+
+          yield lazyIframeIsLoaded(detailsIframe);
+
+          yield nextTick();
+
+          yield detailsIframe.contentWindow.getDescriptionPromise;
+
+          // device info and permissions content is checked in other tests
+          // We just test one value to make sure we get something
+
+          let doc = detailsIframe.contentWindow.document;
+          let trs = doc.querySelectorAll("tr");
+          let found = false;
+
+          for (let tr of trs) {
+            let [name,val] = tr.querySelectorAll("td");
+            if (name.textContent == "appid") {
+              found = true;
+              is(val.textContent, Services.appinfo.ID, "appid has the right value");
+              break;
+            }
+          }
+          ok(found, "Found appid line");
+
+          doc.querySelector("#close").click();
+
+          ok(!deck.selectedPanel, "No panel selected");
+
+          DebuggerServer.destroy();
+
+          yield closeWebIDE(win);
+
+          SimpleTest.finish();
+        }).then(null, e => {
+          ok(false, "Exception: " + e);
+          SimpleTest.finish();
+        });
+      }
+    </script>
+  </body>
+</html>
--- a/browser/devtools/webide/test/test_device_settings.html
+++ b/browser/devtools/webide/test/test_device_settings.html
@@ -29,35 +29,36 @@
             DebuggerServer.init();
             DebuggerServer.addBrowserActors();
           }
 
           let win = yield openWebIDE();
 
           let settingIframe = win.document.querySelector("#deck-panel-devicesettings");
 
-          yield documentIsLoaded(settingIframe.contentWindow.document);
-
           win.AppManager.update("runtimelist");
 
           yield connectToLocalRuntime(win);
 
-          yield nextTick();
-
           let settings = win.document.querySelector("#cmd_showSettings");
 
           ok(!settings.hasAttribute("disabled"), "device settings cmd enabled");
 
           let deck = win.document.querySelector("#deck");
 
           win.Cmds.showSettings();
           is(deck.selectedPanel, settingIframe, "device settings iframe selected");
 
+          yield nextTick();
+
+          yield lazyIframeIsLoaded(settingIframe);
+
+          yield nextTick();
+
           yield settingIframe.contentWindow.getAllSettings;
-          yield nextTick();
 
           setDocument(settingIframe);
 
           let fields = doc.querySelectorAll(".editable");
 
           addNewField();
 
           addNewFieldWithEnter();
deleted file mode 100644
--- a/browser/devtools/webide/test/test_deviceinfo.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-
-  <head>
-    <meta charset="utf8">
-    <title></title>
-
-    <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-    <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
-    <script type="application/javascript;version=1.8" src="head.js"></script>
-    <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-  </head>
-
-  <body>
-
-    <script type="application/javascript;version=1.8">
-      window.onload = function() {
-        SimpleTest.waitForExplicitFinish();
-
-        Task.spawn(function* () {
-          Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
-
-          if (!DebuggerServer.initialized) {
-            DebuggerServer.init();
-            DebuggerServer.addBrowserActors();
-          }
-
-          let win = yield openWebIDE();
-
-          let permIframe = win.document.querySelector("#deck-panel-permissionstable");
-          let infoIframe = win.document.querySelector("#deck-panel-runtimedetails");
-
-          yield documentIsLoaded(permIframe.contentWindow.document);
-          yield documentIsLoaded(infoIframe.contentWindow.document);
-
-          yield connectToLocalRuntime(win);
-
-          yield nextTick();
-
-          let perm = win.document.querySelector("#cmd_showPermissionsTable");
-          let info = win.document.querySelector("#cmd_showRuntimeDetails");
-
-          ok(!perm.hasAttribute("disabled"), "perm cmd enabled");
-          ok(!info.hasAttribute("disabled"), "info cmd enabled");
-
-          let deck = win.document.querySelector("#deck");
-
-          win.Cmds.showRuntimeDetails();
-          is(deck.selectedPanel, infoIframe, "info iframe selected");
-
-          yield infoIframe.contentWindow.getDescriptionPromise;
-
-          yield nextTick();
-
-          // device info and permissions content is checked in other tests
-          // We just test one value to make sure we get something
-
-          let doc = infoIframe.contentWindow.document;
-          let trs = doc.querySelectorAll("tr");
-          let found = false;
-
-          for (let tr of trs) {
-            let [name,val] = tr.querySelectorAll("td");
-            if (name.textContent == "appid") {
-              found = true;
-              is(val.textContent, Services.appinfo.ID, "appid has the right value");
-            }
-          }
-          ok(found, "Found appid line");
-
-          win.Cmds.showPermissionsTable();
-          is(deck.selectedPanel, permIframe, "permission iframe selected");
-
-          yield permIframe.contentWindow.getRawPermissionsTablePromise;
-
-          yield nextTick();
-
-          doc = permIframe.contentWindow.document;
-          trs = doc.querySelectorAll(".line");
-          found = false;
-          for (let tr of trs) {
-            let [name,v1,v2,v3] = tr.querySelectorAll("td");
-            if (name.textContent == "geolocation") {
-              found = true;
-              is(v1.className, "permprompt", "geolocation perm is valid");
-              is(v2.className, "permprompt", "geolocation perm is valid");
-              is(v3.className, "permprompt", "geolocation perm is valid");
-            }
-          }
-          ok(found, "Found geolocation line");
-
-          doc.querySelector("#close").click();
-
-          ok(!deck.selectedPanel, "No panel selected");
-
-          DebuggerServer.destroy();
-
-          yield closeWebIDE(win);
-
-          SimpleTest.finish();
-
-
-        }).then(null, e => {
-          ok(false, "Exception: " + e);
-          SimpleTest.finish();
-        });
-      }
-
-
-    </script>
-  </body>
-</html>