Bug 929159 - Add output-parser to SrcdirProvider and test mapping. r=jwalker

This commit is contained in:
J. Ryan Stinnett 2013-10-21 16:17:12 -05:00
parent fb5b16f4b3
commit adbbbe5d87
4 changed files with 56 additions and 1 deletions

View File

@ -24,7 +24,8 @@ 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.
@ -104,6 +105,7 @@ var SrcdirProvider = {
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"));
@ -122,6 +124,7 @@ var SrcdirProvider = {
"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,

View File

@ -0,0 +1 @@
[test_loader_paths.html]

View File

@ -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>

View File

@ -6,4 +6,5 @@
MODULE = 'test_devtools'
MOCHITEST_CHROME_MANIFESTS += ['mochitest/chrome.ini']
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']