Bug 1249119 - Test loading the inspector while the document is loading. r=pbrosset
MozReview-Commit-ID: 9iNKx2NUK0T
--- 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");
+});