Backed out changeset b17854552298 (bug 1042252) for intermittent test failures
authorEd Morley <emorley@mozilla.com>
Thu, 21 Aug 2014 11:19:24 +0100
changeset 200678 f734fbcc3de7c68bdf72b7635ca1fc5b219fe20a
parent 200677 fdef8a2d74b77448fefef61f3fbbde0a60b04d90
child 200679 3b1781bae995c7b96cc4c3e2aa309c6344c0f86b
child 200848 c14e5feadc61861bac45f20a31b3c64f2c0fdf3c
push id8310
push useremorley@mozilla.com
push dateThu, 21 Aug 2014 10:19:41 +0000
treeherderfx-team@f734fbcc3de7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1042252
milestone34.0a1
backs outb1785455229890b2899e1a525070925b477267d7
Backed out changeset b17854552298 (bug 1042252) for intermittent test failures
mobile/android/base/tests/robocop.ini
mobile/android/base/tests/roboextender/testNativeWindow.html
mobile/android/base/tests/testNativeWindow.java
--- a/mobile/android/base/tests/robocop.ini
+++ b/mobile/android/base/tests/robocop.ini
@@ -97,17 +97,16 @@ skip-if = android_version == "10"
 # Using JavascriptTest
 [testAccounts]
 [testAndroidLog]
 [testBrowserDiscovery]
 [testDebuggerServer]
 [testDeviceSearchEngine]
 [testJNI]
 # [testMozPay] # see bug 945675
-[testNativeWindow]
 [testOrderedBroadcast]
 [testResourceSubstitutions]
 [testRestrictedProfiles]
 [testSharedPreferences]
 [testSimpleDiscovery]
 [testUITelemetry]
 [testVideoDiscovery]
 
deleted file mode 100644
--- a/mobile/android/base/tests/roboextender/testNativeWindow.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<html>
-  <head>
-    <title>NativeWindow test page</title>
-    <meta name="viewport" content="initial-scale=1.0"/>
-    <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-    <script type="application/javascript">
-Components.utils.import("resource://gre/modules/Messaging.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-const TOAST_TEXT = "TOAST!";
-const MENU_TEXT1 = "MENU-A";
-const MENU_TEXT2 = "MENU-B";
-const DOORHANGER_TEXT = "DOORHANGER";
-const DOORHANGER_BUTTON1 = "BUTTON1";
-const DOORHANGER_BUTTON2 = "BUTTON2";
-const DOORHANGER_CHECK = "CHECKBOX";
-
-// Entry point for the roboextender style tests. Called from <body onload>
-function start() {
-  // Grad the name of the test from the hash/anchor
-  var test = location.hash.substring(1);
-  window[test]();
-}
-
-// Show a toast and expect Java to watch for it to appear
-function showToast() {
-  // Signal Java that we are ready so Java can start looking for the toast text
-  sendMessageToJava({ type: "TestNativeWindow:ShowToast" });
-
-  // Show the toast
-  var chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  chromeWin.NativeWindow.toast.show(TOAST_TEXT, "short");
-}
-
-// Add a menu and expect Java to find it and click it
-function addMenu() {
-  // Add the menu
-  var chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  var menuID = chromeWin.NativeWindow.menu.add({
-    name: MENU_TEXT1,
-    icon: null,
-    callback: function() {
-      sendMessageToJava({ type: "TestNativeWindow:FireMenu" });
-    }
-  });
-
-  // Save the menuID for the next tests
-  Services.prefs.setIntPref("test.nativewindow.menuID", menuID);
-
-  // Signal Java that we are ready. We signal last so there is no race.
-  sendMessageToJava({ type: "TestNativeWindow:AddMenu" });
-}
-
-// Update the menu text and expect Java to find it and click it
-function updateMenu() {
-  // Get the menu's ID from storage
-  menuID = Services.prefs.getIntPref("test.nativewindow.menuID");
-
-  var chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  chromeWin.NativeWindow.menu.update(menuID, {
-    name: MENU_TEXT2,
-  });
-
-  // Signal Java that we are ready. We signal last so there is no race.
-  sendMessageToJava({ type: "TestNativeWindow:UpdateMenu" });
-}
-
-// Remove the menu and expect Java to not find it
-function removeMenu() {
-  // Get the menu's ID from storage
-  menuID = Services.prefs.getIntPref("test.nativewindow.menuID");
-
-  // Remove the menu
-  var chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  chromeWin.NativeWindow.menu.remove(menuID);
-
-  // Signal Java that we are ready. We signal last so there is no race.
-  sendMessageToJava({ type: "TestNativeWindow:RemoveMenu" });
-}
-
-// Add a doorhanger
-function addDoorhanger() {
-  var buttons = [
-    {
-      label: DOORHANGER_BUTTON1,
-      callback: function(aChecked) {
-        // If the user checked "Don't ask again", make a permanent exception
-        if (aChecked)
-          sendMessageToJava({ type: "TestNativeWindow:FireDoorhangerChecked" });
-        else
-          sendMessageToJava({ type: "TestNativeWindow:FireDoorhanger" });
-      }
-    },
-    {
-      label: DOORHANGER_BUTTON2,
-      callback: function(aChecked) {
-        // Do nothing
-      }
-    }
-  ];
-
-  // Show the doorhanger
-  var chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
-  chromeWin.NativeWindow.doorhanger.show(DOORHANGER_TEXT, "test-nativewindow", buttons, null, { checkbox: DOORHANGER_CHECK });
-
-  // Signal Java that we are ready. We signal last so there is no race.
-  sendMessageToJava({ type: "TestNativeWindow:AddDoorhanger" });
-}
-    </script>
-  </head>
-  <body onload="start();">
-  </body>
-</html>
deleted file mode 100644
--- a/mobile/android/base/tests/testNativeWindow.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package org.mozilla.gecko.tests;
-
-import org.mozilla.gecko.Actions;
-
-import android.widget.CheckBox;
-
-import java.util.ArrayList;
-
-public class testNativeWindow extends BaseTest {
-
-    private static final String TEST_URL = "chrome://roboextender/content/testNativeWindow.html";
-    private static final String TOAST_TEXT = "TOAST!";
-    private static final String MENU_TEXT1 = "MENU-A";
-    private static final String MENU_TEXT2 = "MENU-B";
-    private static final String DOORHANGER_TEXT = "DOORHANGER";
-    private static final String DOORHANGER_BUTTON1 = "BUTTON1";
-    private static final String DOORHANGER_BUTTON2 = "BUTTON2";
-    private static final String DOORHANGER_CHECK = "CHECKBOX";
-
-    public void testNativeWindow() {
-        blockForGeckoReady();
-
-        // NOTE: These test methods depend on being run in this order.
-        addToastTest();
-
-        prepNextTest();
-        addMenuTest();
-
-        prepNextTest();
-        updateMenuTest();
-
-        prepNextTest();
-        removeMenuTest();
-
-        prepNextTest();
-        addDoorhangerTest();
-    }
-
-    /**
-     * Load about:blank between each test to ensure we reset state.
-     */
-    private void prepNextTest() {
-        loadUrl("about:blank");
-        mAsserter.ok(waitForText("about:blank"), "Loaded blank page", "page title match");
-    }
-
-    /**
-     * Shows a toast, verifies that it appears when it should.
-     */
-    private void addToastTest() {
-        Actions.EventExpecter eventExpecter = mActions.expectGeckoEvent("TestNativeWindow:ShowToast");
-        loadUrl(TEST_URL + "#showToast");
-        eventExpecter.blockForEvent();
-
-        // Verify that the toast is visible with the correct text.
-        mAsserter.ok(waitForText(TOAST_TEXT), "Waiting for the toast", "Toast has been displayed");
-    }
-
-    /**
-     * Adds a menu and verifies the callback fires when clicked.
-     */
-    private void addMenuTest() {
-        Actions.EventExpecter eventExpecter = mActions.expectGeckoEvent("TestNativeWindow:AddMenu");
-        loadUrl(TEST_URL + "#addMenu");
-        eventExpecter.blockForEvent();
-
-        // Press the menu and wait for the callback to send a message
-        Actions.EventExpecter menuExpecter = mActions.expectGeckoEvent("TestNativeWindow:FireMenu");
-        selectMenuItem(MENU_TEXT1);
-        menuExpecter.blockForEvent();
-    }
-
-    /**
-     * Updates a menu and verifies the callback fires when clicked.
-     */
-    private void updateMenuTest() {
-        // Load about:home and make sure the onshown handler is called.
-        Actions.EventExpecter eventExpecter = mActions.expectGeckoEvent("TestNativeWindow:UpdateMenu");
-        loadUrl(TEST_URL + "#updateMenu");
-        eventExpecter.blockForEvent();
-
-        // Press the menu and wait for the callback to send a message
-        Actions.EventExpecter menuExpecter = mActions.expectGeckoEvent("TestNativeWindow:FireMenu");
-        selectMenuItem(MENU_TEXT2);
-        menuExpecter.blockForEvent();
-    }
-
-    /**
-     * Removes a menu and verifies the menu is not found.
-     */
-    private void removeMenuTest() {
-        Actions.EventExpecter eventExpecter = mActions.expectGeckoEvent("TestNativeWindow:RemoveMenu");
-        loadUrl(TEST_URL + "#removeMenu");
-        eventExpecter.blockForEvent();
-
-        // Do a simple search for the menu text on the main menu
-        mActions.sendSpecialKey(Actions.SpecialKey.MENU);
-        waitForText("^New Tab$");
-        mAsserter.ok(mSolo.searchText("^" + MENU_TEXT2 + "$") == false, "Checking for menu", "Menu has been removed");
-
-        // Close the menu, if it's still open
-        if (mSolo.searchText("^New Tab$")) {
-            mActions.sendSpecialKey(Actions.SpecialKey.BACK);
-        }
-    }
-
-    /**
-     * Adds a doorhanger and verifies the callback fires when clicked.
-     */
-    private void addDoorhangerTest() {
-        Actions.EventExpecter eventExpecter = mActions.expectGeckoEvent("TestNativeWindow:AddDoorhanger");
-        loadUrl(TEST_URL + "#addDoorhanger");
-        eventExpecter.blockForEvent();
-
-        // Press the doorhanger button and wait for the callback to send a message
-        Actions.EventExpecter menuExpecter = mActions.expectGeckoEvent("TestNativeWindow:FireDoorhanger");
-        waitForText(DOORHANGER_TEXT);
-
-        // Uncheck the checkbox
-        ArrayList<CheckBox> checkBoxes = mSolo.getCurrentViews(CheckBox.class);
-        mAsserter.ok(checkBoxes.size() == 1, "checkbox count", "only one checkbox visible");
-        mAsserter.ok(mSolo.isCheckBoxChecked(0), "checkbox checked", "checkbox is checked");
-        mSolo.clickOnCheckBox(0);
-        mAsserter.ok(!mSolo.isCheckBoxChecked(0), "checkbox not checked", "checkbox is not checked");
-
-        mSolo.clickOnText(DOORHANGER_BUTTON1);
-
-        menuExpecter.blockForEvent();
-    }
-}