Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/browser/extensions/extension_startup_unittest.cc

Issue 126137: Part 1 of merging Extensions and DOMUI (Closed)
Patch Set: add test and rebase Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <vector> 1 #include <vector>
2 2
3 #include "base/command_line.h" 3 #include "base/command_line.h"
4 #include "base/file_path.h" 4 #include "base/file_path.h"
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "chrome/browser/browser.h" 7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/extensions/extensions_service.h" 8 #include "chrome/browser/extensions/extensions_service.h"
9 #include "chrome/browser/profile.h" 9 #include "chrome/browser/profile.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // Test that the content script ran. 145 // Test that the content script ran.
146 bool result = false; 146 bool result = false;
147 ui_test_utils::ExecuteJavaScriptAndExtractBool( 147 ui_test_utils::ExecuteJavaScriptAndExtractBool(
148 browser()->GetSelectedTabContents(), L"", 148 browser()->GetSelectedTabContents(), L"",
149 L"window.domAutomationController.send(" 149 L"window.domAutomationController.send("
150 L"document.defaultView.getComputedStyle(document.body, null)." 150 L"document.defaultView.getComputedStyle(document.body, null)."
151 L"getPropertyValue('background-color') == 'rgb(245, 245, 220)')", 151 L"getPropertyValue('background-color') == 'rgb(245, 245, 220)')",
152 &result); 152 &result);
153 EXPECT_TRUE(result); 153 EXPECT_TRUE(result);
154 154
155 result = false;
155 ui_test_utils::ExecuteJavaScriptAndExtractBool( 156 ui_test_utils::ExecuteJavaScriptAndExtractBool(
156 browser()->GetSelectedTabContents(), L"", 157 browser()->GetSelectedTabContents(), L"",
157 L"window.domAutomationController.send(document.title == 'Modified')", 158 L"window.domAutomationController.send(document.title == 'Modified')",
158 &result); 159 &result);
159 EXPECT_TRUE(result); 160 EXPECT_TRUE(result);
160 161
162 // Load an extension page into the tab area to make sure it works.
163 result = false;
164 ui_test_utils::NavigateToURL(
165 browser(),
166 GURL("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/page.html"));
167 ui_test_utils::ExecuteJavaScriptAndExtractBool(
168 browser()->GetSelectedTabContents(), L"", L"testTabsAPI()", &result);
169 EXPECT_TRUE(result);
170
161 // TODO(aa): Move the stuff in ExtensionBrowserTest here? 171 // TODO(aa): Move the stuff in ExtensionBrowserTest here?
162 } 172 }
163 173
164 174
165 // ExtensionsStartupUserScriptTest 175 // ExtensionsStartupUserScriptTest
166 // Tests that we can startup with --enable-user-scripts and run user sripts and 176 // Tests that we can startup with --enable-user-scripts and run user sripts and
167 // see them do basic things. 177 // see them do basic things.
168 178
169 class ExtensionsStartupUserScriptTest : public ExtensionStartupTestBase { 179 class ExtensionsStartupUserScriptTest : public ExtensionStartupTestBase {
170 public: 180 public:
(...skipping 24 matching lines...) Expand all
195 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file)); 205 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file));
196 206
197 // Test that the user script ran. 207 // Test that the user script ran.
198 bool result = false; 208 bool result = false;
199 ui_test_utils::ExecuteJavaScriptAndExtractBool( 209 ui_test_utils::ExecuteJavaScriptAndExtractBool(
200 browser()->GetSelectedTabContents(), L"", 210 browser()->GetSelectedTabContents(), L"",
201 L"window.domAutomationController.send(document.title == 'Modified')", 211 L"window.domAutomationController.send(document.title == 'Modified')",
202 &result); 212 &result);
203 EXPECT_TRUE(result); 213 EXPECT_TRUE(result);
204 } 214 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698