Bug 1249119 - Test loading the inspector while the document is loading. r=pbrosset draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 11 Oct 2016 09:23:09 -0700
changeset 423781 ae387c0b9db2db66913edac3da647b6f4939ba17
parent 423780 3e90e96dce91d8499fe57c4f29021e566320e34a
child 423782 2ee6b04ba9be76dbacc97084bdcd13efb31f7213
push id31984
push userbmo:poirot.alex@gmail.com
push dateTue, 11 Oct 2016 16:43:39 +0000
reviewerspbrosset
bugs1249119
milestone52.0a1
Bug 1249119 - Test loading the inspector while the document is loading. r=pbrosset MozReview-Commit-ID: 9iNKx2NUK0T
devtools/client/inspector/test/browser.ini
devtools/client/inspector/test/browser_inspector_open_on_loading_document.js
--- a/devtools/client/inspector/test/browser.ini
+++ b/devtools/client/inspector/test/browser.ini
@@ -123,16 +123,17 @@ subsuite = clipboard
 [browser_inspector_menu-03-paste-items.js]
 subsuite = clipboard
 [browser_inspector_menu-03-paste-items-svg.js]
 subsuite = clipboard
 [browser_inspector_menu-04-use-in-console.js]
 [browser_inspector_menu-05-attribute-items.js]
 [browser_inspector_menu-06-other.js]
 [browser_inspector_navigation.js]
+[browser_inspector_open_on_loading_document.js]
 [browser_inspector_pane-toggle-01.js]
 [browser_inspector_pane-toggle-02.js]
 [browser_inspector_pane-toggle-03.js]
 [browser_inspector_pane-toggle-05.js]
 skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard
 [browser_inspector_picker-stop-on-destroy.js]
 [browser_inspector_picker-stop-on-tool-change.js]
 [browser_inspector_portrait_mode.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/test/browser_inspector_open_on_loading_document.js
@@ -0,0 +1,22 @@
+/* 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/. */
+
+"use strict";
+
+// Test that the inspector is able to load without breakage on a loading document
+
+const TEST_URL = "data:text/html;charset=utf-8,<script>new " + function () {
+  onload = function () {
+    if (location.href.split("foo").length < 200) {
+      location.replace(window.location + " foo");
+    }
+  }
+} + "</script>";
+
+add_task(function* () {
+  // Load a document that reloads itself 200 times
+  yield addTab(TEST_URL);
+  yield openInspector();
+  ok(true, "inspector loaded");
+});