Bug 929159 - Add output-parser to SrcdirProvider and test mapping. r=jwalker
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 21 Oct 2013 16:17:12 -0500
changeset 165885 397c16bf52a5a1bae1e6281f82754b57eb6c939b
parent 165884 1623dffd15e1be92ee2a3da5771af1df8d5eeda5
child 165886 18684ec60867c91f4d5715ccd6c2835087e3916c
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalker
bugs929159
milestone27.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 929159 - Add output-parser to SrcdirProvider and test mapping. r=jwalker
toolkit/devtools/Loader.jsm
toolkit/devtools/tests/mochitest/chrome.ini
toolkit/devtools/tests/mochitest/test_loader_paths.html
toolkit/devtools/tests/moz.build
--- a/toolkit/devtools/Loader.jsm
+++ b/toolkit/devtools/Loader.jsm
@@ -19,17 +19,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "console", "resource://gre/modules/devtools/Console.jsm");
 
 let SourceMap = {};
 Cu.import("resource://gre/modules/devtools/SourceMap.jsm", SourceMap);
 
 let loader = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}).Loader;
 let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
 
-this.EXPORTED_SYMBOLS = ["DevToolsLoader", "devtools"];
+this.EXPORTED_SYMBOLS = ["DevToolsLoader", "devtools", "BuiltinProvider",
+                         "SrcdirProvider"];
 
 /**
  * Providers are different strategies for loading the devtools.
  */
 
 let loaderGlobals = {
   btoa: btoa,
   console: console,
@@ -99,16 +100,17 @@ var SrcdirProvider = {
     let toolkitDir = OS.Path.join(srcdir, "toolkit", "devtools");
     let mainURI = this.fileURI(OS.Path.join(devtoolsDir, "main.js"));
     let devtoolsURI = this.fileURI(devtoolsDir);
     let serverURI = this.fileURI(OS.Path.join(toolkitDir, "server"));
     let webconsoleURI = this.fileURI(OS.Path.join(toolkitDir, "webconsole"));
     let appActorURI = this.fileURI(OS.Path.join(toolkitDir, "apps", "app-actor-front.js"));
     let cssLogicURI = this.fileURI(OS.Path.join(toolkitDir, "styleinspector", "css-logic"));
     let cssColorURI = this.fileURI(OS.Path.join(toolkitDir, "css-color"));
+    let outputParserURI = this.fileURI(OS.Path.join(toolkitDir, "output-parser"));
     let touchEventsURI = this.fileURI(OS.Path.join(toolkitDir, "touch-events"));
     let clientURI = this.fileURI(OS.Path.join(toolkitDir, "client"));
     let escodegenURI = this.fileURI(OS.Path.join(toolkitDir, "escodegen"));
     let estraverseURI = this.fileURI(OS.Path.join(toolkitDir, "escodegen", "estraverse"));
     this.loader = new loader.Loader({
       modules: {
         "toolkit/loader": loader,
         "source-map": SourceMap,
@@ -117,16 +119,17 @@ var SrcdirProvider = {
         "": "resource://gre/modules/commonjs/",
         "main": mainURI,
         "devtools": devtoolsURI,
         "devtools/server": serverURI,
         "devtools/toolkit/webconsole": webconsoleURI,
         "devtools/app-actor-front": appActorURI,
         "devtools/styleinspector/css-logic": cssLogicURI,
         "devtools/css-color": cssColorURI,
+        "devtools/output-parser": outputParserURI,
         "devtools/touch-events": touchEventsURI,
         "devtools/client": clientURI,
         "escodegen": escodegenURI,
         "estraverse": estraverseURI
       },
       globals: loaderGlobals
     });
 
new file mode 100644
--- /dev/null
+++ b/toolkit/devtools/tests/mochitest/chrome.ini
@@ -0,0 +1,1 @@
+[test_loader_paths.html]
new file mode 100644
--- /dev/null
+++ b/toolkit/devtools/tests/mochitest/test_loader_paths.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<!--
+  Any copyright is dedicated to the Public Domain.
+  http://creativecommons.org/publicdomain/zero/1.0/
+-->
+
+<html>
+
+  <head>
+    <meta charset="utf8">
+    <title></title>
+
+    <script type="application/javascript"
+            src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+    <link rel="stylesheet" type="text/css"
+          href="chrome://mochikit/content/tests/SimpleTest/test.css">
+  </head>
+
+  <body>
+
+    <script type="application/javascript;version=1.8">
+      const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
+
+      const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+
+      const SRCDIR_PREF = "devtools.loader.srcdir";
+      let srcDir = Cc["@mozilla.org/file/directory_service;1"]
+                   .getService(Components.interfaces.nsIProperties)
+                   .get("CurWorkD", Components.interfaces.nsIFile).path;
+
+      let srcDirStr = Cc["@mozilla.org/supports-string;1"]
+                      .createInstance(Ci.nsISupportsString);
+      srcDirStr.data = srcDir;
+      Services.prefs.setComplexValue(SRCDIR_PREF, Ci.nsISupportsString,
+                                     srcDirStr);
+
+      const { BuiltinProvider, SrcdirProvider } =
+        Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
+
+      BuiltinProvider.load();
+      SrcdirProvider.load();
+
+      is(BuiltinProvider.loader.mapping.length,
+         SrcdirProvider.loader.mapping.length + 1,
+         "The built-in loader should have only one more mapping for testing.");
+
+      Services.prefs.clearUserPref(SRCDIR_PREF);
+    </script>
+  </body>
+</html>
--- a/toolkit/devtools/tests/moz.build
+++ b/toolkit/devtools/tests/moz.build
@@ -1,9 +1,10 @@
 # -*- Mode: python; c-basic-offset: 4; 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/.
 
 MODULE = 'test_devtools'
 
+MOCHITEST_CHROME_MANIFESTS += ['mochitest/chrome.ini']
 XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']