Bug 1184186 - Convert robocop testAccounts to mochitest-chrome; r=rnewman
authorGeoff Brown <gbrown@mozilla.com>
Mon, 03 Aug 2015 12:00:55 -0600
changeset 287618 2d440acf37fe4fd69d0735fe5cafcfef34c7a62b
parent 287617 3fc1d9ffd07981c15cff6447383ed79710dd3752
child 287619 f425dbcf5e3236f75d79b662a4cca518c837afb3
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1184186
milestone42.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 1184186 - Convert robocop testAccounts to mochitest-chrome; r=rnewman
mobile/android/tests/browser/chrome/chrome.ini
mobile/android/tests/browser/chrome/test_accounts.html
mobile/android/tests/browser/robocop/robocop.ini
mobile/android/tests/browser/robocop/testAccounts.java
mobile/android/tests/browser/robocop/testAccounts.js
--- a/mobile/android/tests/browser/chrome/chrome.ini
+++ b/mobile/android/tests/browser/chrome/chrome.ini
@@ -1,7 +1,8 @@
 [DEFAULT]
 skip-if = os != 'android'
 support-files =
 
 [test_about_logins.html]
+[test_accounts.html]
 [test_app_constants.html]
 [test_resource_substitutions.html]
new file mode 100644
--- /dev/null
+++ b/mobile/android/tests/browser/chrome/test_accounts.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=917942
+Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 917942</title>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+  <script type="application/javascript;version=1.7">
+
+  Components.utils.import("resource://gre/modules/Accounts.jsm");
+
+  add_task(function* () {
+    let syncExists = yield Accounts.syncAccountsExist();
+    info("Sync account exists? " + syncExists + "\n");
+    let firefoxExists = yield Accounts.firefoxAccountsExist();
+    info("Firefox account exists? " + firefoxExists + "\n");
+    let anyExists = yield Accounts.anySyncAccountsExist();
+    info("Any accounts exist? " + anyExists + "\n");
+
+    // Only one account should exist.
+    ok(!syncExists || !firefoxExists, "at least one account does not exist");
+    is(anyExists, firefoxExists || syncExists, "sync/firefox account existence consistent with any existence");
+
+    // TODO: How can this be cleaned up?
+    //info("Launching setup.\n");
+    //Accounts.launchSetup();
+  });
+
+  </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=917942">Mozilla Bug 917942</a>
+<br>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testAccounts</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>
--- a/mobile/android/tests/browser/robocop/robocop.ini
+++ b/mobile/android/tests/browser/robocop/robocop.ini
@@ -105,17 +105,16 @@ skip-if = android_version == "10" || and
 skip-if = android_version == "10" || android_version == "18"
 # [testThumbnails.java] # see bug 813107
 [testTitleBar.java]
 # disabled on Android 2.3, bug 979552; on 4.3, bug 1145881
 skip-if = android_version == "10" || android_version == "18"
 # [testVkbOverlap.java] # see bug 907274
 
 # Using JavascriptTest
-[testAccounts.java]
 [testAndroidLog.java]
 [testBrowserDiscovery.java]
 # disabled on 4.3, bug 1158384
 skip-if = android_version == "18"
 [testDebuggerServer.java]
 [testDesktopUserAgent.java]
 [testDeviceSearchEngine.java]
 [testFilePicker.java]
deleted file mode 100644
--- a/mobile/android/tests/browser/robocop/testAccounts.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/* 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/. */
-
-package org.mozilla.gecko.tests;
-
-
-public class testAccounts extends JavascriptTest {
-    public testAccounts() {
-        super("testAccounts.js");
-    }
-
-    @Override
-    public void testJavascript() throws Exception {
-        super.testJavascript();
-
-        // Rather than waiting for the JS call to message
-        // Java and wait for the Activity to launch, we just
-        // don't test these.
-        /*
-        android.app.Activity activity = mSolo.getCurrentActivity();
-        System.out.println("Current activity: " + activity);
-        mAsserter.ok(activity instanceof FxAccountGetStartedActivity, "checking activity", "setup activity launched");
-        */
-    }
-}
deleted file mode 100644
--- a/mobile/android/tests/browser/robocop/testAccounts.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-/* 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/. */
-
-Components.utils.import("resource://gre/modules/Accounts.jsm");
-
-add_task(function test_Accounts() {
-  let syncExists = yield Accounts.syncAccountsExist();
-  dump("Sync account exists? " + syncExists + "\n");
-  let firefoxExists = yield Accounts.firefoxAccountsExist();
-  dump("Firefox account exists? " + firefoxExists + "\n");
-  let anyExists = yield Accounts.anySyncAccountsExist();
-  dump("Any accounts exist? " + anyExists + "\n");
-
-  // Only one account should exist.
-  do_check_true(!syncExists || !firefoxExists);
-  do_check_eq(anyExists, firefoxExists || syncExists);
-
-  dump("Launching setup.\n");
-  Accounts.launchSetup();
-});
-
-run_next_test();