OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/api/runtime/runtime_api.h" | 5 #include "chrome/browser/extensions/api/runtime/runtime_api.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_function_test_utils.h" | 7 #include "chrome/browser/extensions/extension_function_test_utils.h" |
8 #include "chrome/test/base/ui_test_utils.h" | 8 #include "chrome/test/base/ui_test_utils.h" |
| 9 #include "net/test/embedded_test_server/embedded_test_server.h" |
9 | 10 |
10 // Tests the privileged components of chrome.runtime. | 11 // Tests the privileged components of chrome.runtime. |
11 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimePrivileged) { | 12 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimePrivileged) { |
12 ASSERT_TRUE(RunExtensionTest("runtime/privileged")) << message_; | 13 ASSERT_TRUE(RunExtensionTest("runtime/privileged")) << message_; |
13 } | 14 } |
14 | 15 |
15 // Tests the unprivileged components of chrome.runtime. | 16 // Tests the unprivileged components of chrome.runtime. |
16 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeUnprivileged) { | 17 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeUnprivileged) { |
17 ASSERT_TRUE(StartTestServer()); | 18 ASSERT_TRUE(StartEmbeddedTestServer()); |
18 ASSERT_TRUE( | 19 ASSERT_TRUE( |
19 LoadExtension(test_data_dir_.AppendASCII("runtime/content_script"))); | 20 LoadExtension(test_data_dir_.AppendASCII("runtime/content_script"))); |
20 | 21 |
21 // The content script runs on webpage.html. | 22 // The content script runs on webpage.html. |
22 ResultCatcher catcher; | 23 ResultCatcher catcher; |
23 ui_test_utils::NavigateToURL(browser(), | 24 ui_test_utils::NavigateToURL(browser(), |
24 test_server()->GetURL("webpage.html")); | 25 embedded_test_server()->GetURL("/webpage.html")); |
25 EXPECT_TRUE(catcher.GetNextResult()) << message_; | 26 EXPECT_TRUE(catcher.GetNextResult()) << message_; |
26 } | 27 } |
27 | 28 |
28 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeUninstallUrl) { | 29 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeUninstallUrl) { |
29 ASSERT_TRUE(LoadExtension( | 30 ASSERT_TRUE(LoadExtension( |
30 test_data_dir_.AppendASCII("runtime").AppendASCII("uninstall_url"). | 31 test_data_dir_.AppendASCII("runtime").AppendASCII("uninstall_url"). |
31 AppendASCII("sets_uninstall_url"))); | 32 AppendASCII("sets_uninstall_url"))); |
32 ASSERT_TRUE(RunExtensionTest("runtime/uninstall_url")) << message_; | 33 ASSERT_TRUE(RunExtensionTest("runtime/uninstall_url")) << message_; |
33 } | 34 } |
34 | 35 |
(...skipping 22 matching lines...) Expand all Loading... |
57 } | 58 } |
58 | 59 |
59 // Tests chrome.runtime.getPackageDirectory with an extension. | 60 // Tests chrome.runtime.getPackageDirectory with an extension. |
60 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, | 61 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, |
61 ChromeRuntimeGetPackageDirectoryEntryExtension) { | 62 ChromeRuntimeGetPackageDirectoryEntryExtension) { |
62 ASSERT_TRUE(RunExtensionTest("runtime/get_package_directory/extension")) | 63 ASSERT_TRUE(RunExtensionTest("runtime/get_package_directory/extension")) |
63 << message_; | 64 << message_; |
64 } | 65 } |
65 | 66 |
66 } // namespace extensions | 67 } // namespace extensions |
OLD | NEW |