| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // Load a page affected by the content script and test to see the effect. | 110 // Load a page affected by the content script and test to see the effect. |
| 111 FilePath test_file; | 111 FilePath test_file; |
| 112 PathService::Get(chrome::DIR_TEST_DATA, &test_file); | 112 PathService::Get(chrome::DIR_TEST_DATA, &test_file); |
| 113 test_file = test_file.AppendASCII("extensions") | 113 test_file = test_file.AppendASCII("extensions") |
| 114 .AppendASCII("test_file.html"); | 114 .AppendASCII("test_file.html"); |
| 115 | 115 |
| 116 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file)); | 116 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file)); |
| 117 | 117 |
| 118 bool result = false; | 118 bool result = false; |
| 119 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 119 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 120 browser()->GetSelectedWebContents()->GetRenderViewHost(), L"", | 120 browser()->GetActiveWebContents()->GetRenderViewHost(), L"", |
| 121 L"window.domAutomationController.send(" | 121 L"window.domAutomationController.send(" |
| 122 L"document.defaultView.getComputedStyle(document.body, null)." | 122 L"document.defaultView.getComputedStyle(document.body, null)." |
| 123 L"getPropertyValue('background-color') == 'rgb(245, 245, 220)')", | 123 L"getPropertyValue('background-color') == 'rgb(245, 245, 220)')", |
| 124 &result)); | 124 &result)); |
| 125 EXPECT_EQ(expect_css, result); | 125 EXPECT_EQ(expect_css, result); |
| 126 | 126 |
| 127 result = false; | 127 result = false; |
| 128 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 128 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 129 browser()->GetSelectedWebContents()->GetRenderViewHost(), L"", | 129 browser()->GetActiveWebContents()->GetRenderViewHost(), L"", |
| 130 L"window.domAutomationController.send(document.title == 'Modified')", | 130 L"window.domAutomationController.send(document.title == 'Modified')", |
| 131 &result)); | 131 &result)); |
| 132 EXPECT_EQ(expect_script, result); | 132 EXPECT_EQ(expect_script, result); |
| 133 } | 133 } |
| 134 | 134 |
| 135 FilePath preferences_file_; | 135 FilePath preferences_file_; |
| 136 FilePath extensions_dir_; | 136 FilePath extensions_dir_; |
| 137 FilePath user_scripts_dir_; | 137 FilePath user_scripts_dir_; |
| 138 bool enable_extensions_; | 138 bool enable_extensions_; |
| 139 // Extensions to load from the command line. | 139 // Extensions to load from the command line. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 .AppendASCII("extensions") | 259 .AppendASCII("extensions") |
| 260 .AppendASCII("app2"); | 260 .AppendASCII("app2"); |
| 261 load_extensions_.push_back(fourth_extension_path.value()); | 261 load_extensions_.push_back(fourth_extension_path.value()); |
| 262 } | 262 } |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 265 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
| 266 WaitForServicesToStart(4, true); | 266 WaitForServicesToStart(4, true); |
| 267 TestInjection(true, true); | 267 TestInjection(true, true); |
| 268 } | 268 } |
| OLD | NEW |