| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/test/base/test_switches.h" | 9 #include "chrome/test/base/test_switches.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 #if defined(OS_WIN) && !defined(NDEBUG) | 22 #if defined(OS_WIN) && !defined(NDEBUG) |
| 23 // http://crbug.com/174341 | 23 // http://crbug.com/174341 |
| 24 #define MAYBE_WhitelistedExtension DISABLED_WhitelistedExtension | 24 #define MAYBE_WhitelistedExtension DISABLED_WhitelistedExtension |
| 25 #else | 25 #else |
| 26 #define MAYBE_WhitelistedExtension WhitelistedExtension | 26 #define MAYBE_WhitelistedExtension WhitelistedExtension |
| 27 #endif | 27 #endif |
| 28 IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, MAYBE_WhitelistedExtension) { | 28 IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, MAYBE_WhitelistedExtension) { |
| 29 #if defined(OS_WIN) && defined(USE_ASH) | 29 #if defined(OS_WIN) && defined(USE_ASH) |
| 30 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 30 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 31 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 31 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 32 switches::kAshBrowserTests)) |
| 32 return; | 33 return; |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 // First setup the two extensions. | 36 // First setup the two extensions. |
| 36 base::FilePath extension_dir1 = test_data_dir_.AppendASCII("all_urls") | 37 base::FilePath extension_dir1 = test_data_dir_.AppendASCII("all_urls") |
| 37 .AppendASCII("content_script"); | 38 .AppendASCII("content_script"); |
| 38 base::FilePath extension_dir2 = test_data_dir_.AppendASCII("all_urls") | 39 base::FilePath extension_dir2 = test_data_dir_.AppendASCII("all_urls") |
| 39 .AppendASCII("execute_script"); | 40 .AppendASCII("execute_script"); |
| 40 | 41 |
| 41 // Then add the two extensions to the whitelist. | 42 // Then add the two extensions to the whitelist. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Now verify we can script a regular http page. | 117 // Now verify we can script a regular http page. |
| 117 ASSERT_TRUE(StartEmbeddedTestServer()); | 118 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 118 GURL page_url = embedded_test_server()->GetURL(kAllUrlsTarget); | 119 GURL page_url = embedded_test_server()->GetURL(kAllUrlsTarget); |
| 119 ExtensionTestMessageListener listener1a("content script: " + page_url.spec(), | 120 ExtensionTestMessageListener listener1a("content script: " + page_url.spec(), |
| 120 false); | 121 false); |
| 121 ExtensionTestMessageListener listener1b("execute: " + page_url.spec(), false); | 122 ExtensionTestMessageListener listener1b("execute: " + page_url.spec(), false); |
| 122 ui_test_utils::NavigateToURL(browser(), page_url); | 123 ui_test_utils::NavigateToURL(browser(), page_url); |
| 123 ASSERT_TRUE(listener1a.WaitUntilSatisfied()); | 124 ASSERT_TRUE(listener1a.WaitUntilSatisfied()); |
| 124 ASSERT_TRUE(listener1b.WaitUntilSatisfied()); | 125 ASSERT_TRUE(listener1b.WaitUntilSatisfied()); |
| 125 } | 126 } |
| OLD | NEW |