summaryrefslogtreecommitdiffstats
path: root/addon-sdk/test/browser_sdk_loader_chrome_in_sdk.js
diff options
context:
space:
mode:
Diffstat (limited to 'addon-sdk/test/browser_sdk_loader_chrome_in_sdk.js')
-rw-r--r--addon-sdk/test/browser_sdk_loader_chrome_in_sdk.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/addon-sdk/test/browser_sdk_loader_chrome_in_sdk.js b/addon-sdk/test/browser_sdk_loader_chrome_in_sdk.js
new file mode 100644
index 000000000..02a8c5286
--- /dev/null
+++ b/addon-sdk/test/browser_sdk_loader_chrome_in_sdk.js
@@ -0,0 +1,19 @@
+function test () {
+ let loader = makeLoader();
+ let module = Module("./main", gTestPath);
+ let require = Require(loader, module);
+
+ // sdk/util/uuid uses Cc, Ci, components
+ const { uuid } = require("sdk/util/uuid");
+
+ ok(isUUID(uuid()), "chrome.Cc and chrome.Ci works in SDK includes");
+
+ let uuidString = '00001111-2222-3333-4444-555566667777';
+ let parsed = uuid(uuidString);
+ is(parsed, '{' + uuidString + '}', "chrome.components works in SDK includes");
+
+ // sdk/base64 uses Cu
+ const { encode } = require("sdk/base64");
+ is(encode("hello"), "aGVsbG8=", "chrome.Cu works in SDK includes");
+ finish();
+}