Bug 1184186 - Convert robocop testDebuggerServer to mochitest-chrome; r=jryans
authorGeoff Brown <gbrown@mozilla.com>
Mon, 03 Aug 2015 12:00:55 -0600
changeset 287620 04a6b52d1128849cac3320aec0abc989e56e0050
parent 287619 f425dbcf5e3236f75d79b662a4cca518c837afb3
child 287621 1be9ffae5e972660c8305b842edebfd7de7fcb3c
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)
reviewersjryans
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 testDebuggerServer to mochitest-chrome; r=jryans
mobile/android/tests/browser/chrome/chrome.ini
mobile/android/tests/browser/chrome/test_debugger_server.html
mobile/android/tests/browser/robocop/robocop.ini
mobile/android/tests/browser/robocop/testDebuggerServer.java
mobile/android/tests/browser/robocop/testDebuggerServer.js
--- a/mobile/android/tests/browser/chrome/chrome.ini
+++ b/mobile/android/tests/browser/chrome/chrome.ini
@@ -1,9 +1,10 @@
 [DEFAULT]
 skip-if = os != 'android'
 support-files =
 
 [test_about_logins.html]
 [test_accounts.html]
 [test_android_log.html]
 [test_app_constants.html]
+[test_debugger_server.html]
 [test_resource_substitutions.html]
new file mode 100644
--- /dev/null
+++ b/mobile/android/tests/browser/chrome/test_debugger_server.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1010750
+Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1010750</title>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.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">
+
+  "use strict";
+
+  const { utils: Cu } = Components;
+
+  const DEBUGGER_USB_ENABLED = "devtools.remote.usb.enabled";
+
+  Cu.import("resource://gre/modules/Services.jsm");
+  const { DebuggerServer } =
+    Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
+
+  let win = Services.wm.getMostRecentWindow("navigator:browser");
+
+  win.RemoteDebugger.init();
+
+  SimpleTest.registerCleanupFunction(function() {
+    Services.prefs.clearUserPref(DEBUGGER_USB_ENABLED);
+  });
+
+  // Enable the debugger via the pref it listens for
+  Services.prefs.setBoolPref(DEBUGGER_USB_ENABLED, true);
+
+  ok(DebuggerServer.initialized, "initialized");
+  is(DebuggerServer.listeningSockets, 1, "1 listening socket");
+
+  </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1010750">Mozilla Bug 1010750</a>
+<br>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testDebuggerServer</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
@@ -108,17 +108,16 @@ skip-if = android_version == "10" || and
 # 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
 [testBrowserDiscovery.java]
 # disabled on 4.3, bug 1158384
 skip-if = android_version == "18"
-[testDebuggerServer.java]
 [testDesktopUserAgent.java]
 [testDeviceSearchEngine.java]
 [testFilePicker.java]
 [testHistoryService.java]
 # disabled on 4.3, bug 1116036
 skip-if = android_version == "18"
 [testJavaAddons.java]
 [testJNI.java]
deleted file mode 100644
--- a/mobile/android/tests/browser/robocop/testDebuggerServer.java
+++ /dev/null
@@ -1,11 +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 testDebuggerServer extends JavascriptTest {
-    public testDebuggerServer() {
-        super("testDebuggerServer.js");
-    }
-}
deleted file mode 100644
--- a/mobile/android/tests/browser/robocop/testDebuggerServer.js
+++ /dev/null
@@ -1,33 +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/. */
-
-"use strict";
-
-const { utils: Cu } = Components;
-
-const DEBUGGER_USB_ENABLED = "devtools.remote.usb.enabled";
-
-Cu.import("resource://gre/modules/Services.jsm");
-const { DebuggerServer } =
-  Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
-
-add_test(function() {
-  let window = Services.wm.getMostRecentWindow("navigator:browser");
-
-  window.RemoteDebugger.init();
-
-  // Enable the debugger via the pref it listens for
-  do_register_cleanup(function() {
-    Services.prefs.clearUserPref(DEBUGGER_USB_ENABLED);
-  });
-  Services.prefs.setBoolPref(DEBUGGER_USB_ENABLED, true);
-
-  do_check_true(DebuggerServer.initialized);
-  do_check_eq(DebuggerServer.listeningSockets, 1);
-
-  run_next_test();
-});
-
-run_next_test();