Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / extensions / shared_module_apitest.cc
blobe10a46704e060025178a1ae033a52abba9dcb673
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/extension_apitest.h"
7 using extensions::Extension;
9 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModule) {
10 // import_pass depends on this shared module.
11 // NB: We use LoadExtension instead of InstallExtension here so the public-key
12 // in 'shared' is used to generate the extension ID so it can be imported
13 // correctly. We use InstallExtension otherwise so the loads happen through
14 // the CRX installer which validates imports.
15 ASSERT_TRUE(LoadExtension(
16 test_data_dir_.AppendASCII("shared_module").AppendASCII("shared")));
18 EXPECT_TRUE(RunExtensionTest("shared_module/import_pass"));
20 EXPECT_FALSE(InstallExtension(
21 test_data_dir_.AppendASCII("shared_module")
22 .AppendASCII("import_wrong_version"), 0));
23 EXPECT_FALSE(InstallExtension(
24 test_data_dir_.AppendASCII("shared_module")
25 .AppendASCII("import_non_existent"), 0));