Bug 1363533 - Move nsIJSInspector from devtools/server/ to devtools/platform/. r=jryans,gps draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 15 May 2017 18:53:19 +0200
changeset 582092 5eb47dc2f7e6353e27bb42cbdc66148de0fe1690
parent 582091 6349b07896908a08342e861c18f79b559c4203bb
child 629668 65c17d1894c35c343550ca2ba47cf4653ed7fa2f
push id59969
push userbmo:poirot.alex@gmail.com
push dateSun, 21 May 2017 09:33:51 +0000
reviewersjryans, gps
bugs1363533
milestone55.0a1
Bug 1363533 - Move nsIJSInspector from devtools/server/ to devtools/platform/. r=jryans,gps MozReview-Commit-ID: 3ry7pRiqNWv
build/dumbmake-dependencies
devtools/moz.build
devtools/platform/moz.build
devtools/platform/nsIJSInspector.idl
devtools/platform/nsJSInspector.cpp
devtools/platform/nsJSInspector.h
devtools/platform/tests/unit/.eslintrc.js
devtools/platform/tests/unit/test_nsjsinspector.js
devtools/platform/tests/unit/xpcshell.ini
devtools/server/moz.build
devtools/server/nsIJSInspector.idl
devtools/server/nsJSInspector.cpp
devtools/server/nsJSInspector.h
devtools/server/tests/unit/test_nsjsinspector.js
devtools/server/tests/unit/xpcshell.ini
--- a/build/dumbmake-dependencies
+++ b/build/dumbmake-dependencies
@@ -43,16 +43,17 @@ toolkit/library
   image/build
     image
   intl/build
     intl
   media
   profile
   services
   startupcache
+  devtools/platform
   devtools/server
   devtools/shared
 browser/app
   browser/base
   browser/components
   devtools/client
   browser/locales
   browser/modules
--- a/devtools/moz.build
+++ b/devtools/moz.build
@@ -10,18 +10,20 @@ if CONFIG['MOZ_DEVTOOLS'] and CONFIG['MO
 if CONFIG['MOZ_DEVTOOLS'] == 'all':
     DIRS += [
         'client',
     ]
 
 # `addon` is a special build mode to strip everything except binary components
 # and shim modules that are going to stay in Firefox once DevTools ship as an
 # add-on.
+# `platform` contains all native components
 DIRS += [
     'shim',
+    'platform',
 ]
 
 if CONFIG['MOZ_DEVTOOLS'] != 'addon':
     DIRS += [
         'server',
         'shared',
     ]
 
copy from devtools/server/moz.build
copy to devtools/platform/moz.build
--- a/devtools/server/moz.build
+++ b/devtools/platform/moz.build
@@ -1,44 +1,19 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
-include('../templates.mozbuild')
-
-DIRS += [
-    'actors',
-    'performance',
-    'shims',
-]
-
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
-MOCHITEST_CHROME_MANIFESTS += ['tests/mochitest/chrome.ini']
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
 XPIDL_SOURCES += [
     'nsIJSInspector.idl',
 ]
 
 XPIDL_MODULE = 'jsinspector'
 
 SOURCES += [
     'nsJSInspector.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
-
-DevToolsModules(
-    'child.js',
-    'content-server.jsm',
-    'css-logic.js',
-    'event-parsers.js',
-    'main.js',
-    'primitive.js',
-    'service-worker-child.js',
-    'websocket-server.js',
-    'worker.js'
-)
-
-with Files('**'):
-    BUG_COMPONENT = ('Firefox', 'Developer Tools')
rename from devtools/server/nsIJSInspector.idl
rename to devtools/platform/nsIJSInspector.idl
rename from devtools/server/nsJSInspector.cpp
rename to devtools/platform/nsJSInspector.cpp
rename from devtools/server/nsJSInspector.h
rename to devtools/platform/nsJSInspector.h
new file mode 100644
--- /dev/null
+++ b/devtools/platform/tests/unit/.eslintrc.js
@@ -0,0 +1,19 @@
+// Parent config file for all devtools xpcshell files.
+module.exports = {
+  "extends": [
+    "plugin:mozilla/xpcshell-test"
+  ],
+  "rules": {
+    // Allow non-camelcase so that run_test doesn't produce a warning.
+    "camelcase": "off",
+    // Allow using undefined variables so that tests can refer to functions
+    // and variables defined in head.js files, without having to maintain a
+    // list of globals in each .eslintrc file.
+    // Note that bug 1168340 will eventually help auto-registering globals
+    // from head.js files.
+    "no-undef": "off",
+    "block-scoped-var": "off",
+    // Tests can always import anything.
+    "mozilla/reject-some-requires": "off",
+  }
+}
rename from devtools/server/tests/unit/test_nsjsinspector.js
rename to devtools/platform/tests/unit/test_nsjsinspector.js
--- a/devtools/server/tests/unit/test_nsjsinspector.js
+++ b/devtools/platform/tests/unit/test_nsjsinspector.js
@@ -1,16 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+
 // Test the basic functionality of the nsIJSInspector component.
 var gCount = 0;
 const MAX = 10;
+
 var inspector = Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector);
 var tm = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
 
 // Emulate 10 simultaneously-debugged windows from 3 separate client connections.
 var requestor = (count) => ({
   url: "http://foo/bar/" + count,
   connection: "conn" + (count % 3)
 });
new file mode 100644
--- /dev/null
+++ b/devtools/platform/tests/unit/xpcshell.ini
@@ -0,0 +1,6 @@
+[DEFAULT]
+tags = devtools
+firefox-appdir = browser
+skip-if = toolkit == 'android'
+
+[test_nsjsinspector.js]
--- a/devtools/server/moz.build
+++ b/devtools/server/moz.build
@@ -11,28 +11,16 @@ DIRS += [
     'performance',
     'shims',
 ]
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
 MOCHITEST_CHROME_MANIFESTS += ['tests/mochitest/chrome.ini']
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
-XPIDL_SOURCES += [
-    'nsIJSInspector.idl',
-]
-
-XPIDL_MODULE = 'jsinspector'
-
-SOURCES += [
-    'nsJSInspector.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
-
 DevToolsModules(
     'child.js',
     'content-server.jsm',
     'css-logic.js',
     'event-parsers.js',
     'main.js',
     'primitive.js',
     'service-worker-child.js',
--- a/devtools/server/tests/unit/xpcshell.ini
+++ b/devtools/server/tests/unit/xpcshell.ini
@@ -38,17 +38,16 @@ support-files =
 [test_animation_name.js]
 [test_animation_type.js]
 [test_actor-registry-actor.js]
 [test_nesting-01.js]
 [test_nesting-02.js]
 [test_nesting-03.js]
 [test_forwardingprefix.js]
 [test_getyoungestframe.js]
-[test_nsjsinspector.js]
 [test_dbgactor.js]
 [test_dbgglobal.js]
 [test_dbgclient_debuggerstatement.js]
 [test_attach.js]
 [test_MemoryActor_saveHeapSnapshot_01.js]
 [test_MemoryActor_saveHeapSnapshot_02.js]
 [test_MemoryActor_saveHeapSnapshot_03.js]
 [test_reattach-thread.js]