Backed out changeset a7535132fe8e (bug 1148770) for test bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 08 Apr 2015 16:21:23 -0400
changeset 258383 0f0c47f90ab6
parent 258382 e55db32c5ef6
child 258384 115865f14324
push id4657
push userryanvm@gmail.com
push date2015-04-08 20:55 +0000
treeherdermozilla-beta@bfff2ca94766 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1148770
milestone38.0
backs outa7535132fe8e
Backed out changeset a7535132fe8e (bug 1148770) for test bustage.
browser/devtools/styleeditor/test/browser_styleeditor_bug_870339.js
--- a/browser/devtools/styleeditor/test/browser_styleeditor_bug_870339.js
+++ b/browser/devtools/styleeditor/test/browser_styleeditor_bug_870339.js
@@ -1,44 +1,46 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-const SIMPLE = TEST_BASE_HTTP + "simple.css";
-const DOCUMENT_WITH_ONE_STYLESHEET = "data:text/html;charset=UTF-8," +
-        encodeURIComponent(
-          ["<!DOCTYPE html>",
-           "<html>",
-           " <head>",
-           "  <title>Bug 870339</title>",
-           '  <link rel="stylesheet" type="text/css" href="'+SIMPLE+'">',
-           " </head>",
-           " <body>",
-           " </body>",
-           "</html>"
-          ].join("\n"));
 
-add_task(function* () {
-  let { ui } = yield openStyleEditorForURL(DOCUMENT_WITH_ONE_STYLESHEET);
+function test()
+{
+  const SIMPLE = TEST_BASE_HTTP + "simple.css";
+  const DOCUMENT_WITH_ONE_STYLESHEET = "data:text/html;charset=UTF-8," +
+          encodeURIComponent(
+            ["<!DOCTYPE html>",
+             "<html>",
+             " <head>",
+             "  <title>Bug 870339</title>",
+             '  <link rel="stylesheet" type="text/css" href="'+SIMPLE+'">',
+             " </head>",
+             " <body>",
+             " </body>",
+             "</html>"
+            ].join("\n"));
 
-  // Spam the _onNewDocument callback multiple times before the
-  // StyleEditorActor has a chance to respond to the first one.
-  const SPAM_COUNT = 2;
-  for (let i=0; i<SPAM_COUNT; ++i) {
-    ui._onNewDocument();
-  }
+  waitForExplicitFinish();
+  addTabAndOpenStyleEditors(1, function (aPanel) {
+    let UI = aPanel.UI;
 
-  // Wait for the StyleEditorActor to respond to each "newDocument"
-  // message.
-  yield new Promise(resolve => {
+    // Spam the _onNewDocument callback multiple times before the
+    // StyleEditorActor has a chance to respond to the first one.
+    const SPAM_COUNT = 2;
+    for (let i=0; i<SPAM_COUNT; ++i) {
+      UI._onNewDocument();
+    }
+
+    // Wait for the StyleEditorActor to respond to each "newDocument"
+    // message.
     let loadCount = 0;
-    ui.on("stylesheets-reset", function onReset() {
+    UI.on("stylesheets-reset", function () {
       ++loadCount;
       if (loadCount == SPAM_COUNT) {
-        ui.off("stylesheets-reset", onReset);
         // No matter how large SPAM_COUNT is, the number of style
         // sheets should never be more than the number of style sheets
         // in the document.
-        is(ui.editors.length, 1, "correct style sheet count");
-        resolve();
+        is(UI.editors.length, 1, "correct style sheet count");
+        finish();
       }
     });
   });
-});
+  content.location = DOCUMENT_WITH_ONE_STYLESHEET;
+}