Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / shared_module_apitest.cc
index e10a467..3b31496 100644 (file)
@@ -6,12 +6,13 @@
 
 using extensions::Extension;
 
+// NB: We use LoadExtension instead of InstallExtension for shared modules so
+// the public-keys in their manifests are used to generate the extension ID, so
+// it can be imported correctly.  We use InstallExtension otherwise so the loads
+// happen through the CRX installer which validates imports.
+
 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModule) {
   // import_pass depends on this shared module.
-  // NB: We use LoadExtension instead of InstallExtension here so the public-key
-  // in 'shared' is used to generate the extension ID so it can be imported
-  // correctly.  We use InstallExtension otherwise so the loads happen through
-  // the CRX installer which validates imports.
   ASSERT_TRUE(LoadExtension(
       test_data_dir_.AppendASCII("shared_module").AppendASCII("shared")));
 
@@ -24,3 +25,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModule) {
       test_data_dir_.AppendASCII("shared_module")
           .AppendASCII("import_non_existent"), 0));
 }
+
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModuleWhitelist) {
+  ASSERT_TRUE(LoadExtension(
+      test_data_dir_.AppendASCII("shared_module")
+          .AppendASCII("shared_whitelist")));
+
+  EXPECT_FALSE(InstallExtension(
+      test_data_dir_.AppendASCII("shared_module")
+          .AppendASCII("import_not_in_whitelist"), 0));
+}