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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Load a page affected by the content script and test to see the effect. | 120 // Load a page affected by the content script and test to see the effect. |
121 FilePath test_file; | 121 FilePath test_file; |
122 PathService::Get(chrome::DIR_TEST_DATA, &test_file); | 122 PathService::Get(chrome::DIR_TEST_DATA, &test_file); |
123 test_file = test_file.AppendASCII("extensions") | 123 test_file = test_file.AppendASCII("extensions") |
124 .AppendASCII("test_file.html"); | 124 .AppendASCII("test_file.html"); |
125 | 125 |
126 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file)); | 126 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file)); |
127 | 127 |
128 bool result = false; | 128 bool result = false; |
129 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 129 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
130 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", | 130 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
131 L"window.domAutomationController.send(" | 131 "", |
132 L"document.defaultView.getComputedStyle(document.body, null)." | 132 "window.domAutomationController.send(" |
133 L"getPropertyValue('background-color') == 'rgb(245, 245, 220)')", | 133 "document.defaultView.getComputedStyle(document.body, null)." |
| 134 "getPropertyValue('background-color') == 'rgb(245, 245, 220)')", |
134 &result)); | 135 &result)); |
135 EXPECT_EQ(expect_css, result); | 136 EXPECT_EQ(expect_css, result); |
136 | 137 |
137 result = false; | 138 result = false; |
138 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 139 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
139 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", | 140 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
140 L"window.domAutomationController.send(document.title == 'Modified')", | 141 "", |
| 142 "window.domAutomationController.send(document.title == 'Modified')", |
141 &result)); | 143 &result)); |
142 EXPECT_EQ(expect_script, result); | 144 EXPECT_EQ(expect_script, result); |
143 } | 145 } |
144 | 146 |
145 FilePath preferences_file_; | 147 FilePath preferences_file_; |
146 FilePath extensions_dir_; | 148 FilePath extensions_dir_; |
147 FilePath user_scripts_dir_; | 149 FilePath user_scripts_dir_; |
148 bool enable_extensions_; | 150 bool enable_extensions_; |
149 // Extensions to load from the command line. | 151 // Extensions to load from the command line. |
150 std::vector<FilePath::StringType> load_extensions_; | 152 std::vector<FilePath::StringType> load_extensions_; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 .AppendASCII("extensions") | 275 .AppendASCII("extensions") |
274 .AppendASCII("app2"); | 276 .AppendASCII("app2"); |
275 load_extensions_.push_back(fourth_extension_path.value()); | 277 load_extensions_.push_back(fourth_extension_path.value()); |
276 } | 278 } |
277 }; | 279 }; |
278 | 280 |
279 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 281 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
280 WaitForServicesToStart(4, true); | 282 WaitForServicesToStart(4, true); |
281 TestInjection(true, true); | 283 TestInjection(true, true); |
282 } | 284 } |
OLD | NEW |