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

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

Issue 10535077: TabContentsWrapper -> TabContents, part 12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/extensions/api/permissions/permissions_api.h" 6 #include "chrome/browser/extensions/api/permissions/permissions_api.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 ui_test_utils::NavigateToURL(browser(), url); 100 ui_test_utils::NavigateToURL(browser(), url);
101 101
102 LoadExtension( 102 LoadExtension(
103 test_data_dir_.AppendASCII("content_scripts/existing_renderers")); 103 test_data_dir_.AppendASCII("content_scripts/existing_renderers"));
104 104
105 signal.Wait(); 105 signal.Wait();
106 106
107 // And check that its styles were affected by the styles that just got loaded. 107 // And check that its styles were affected by the styles that just got loaded.
108 bool styles_injected; 108 bool styles_injected;
109 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 109 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
110 browser()->GetSelectedWebContents()->GetRenderViewHost(), L"", 110 browser()->GetActiveWebContents()->GetRenderViewHost(), L"",
111 L"window.domAutomationController.send(" 111 L"window.domAutomationController.send("
112 L"document.defaultView.getComputedStyle(document.body, null)." 112 L"document.defaultView.getComputedStyle(document.body, null)."
113 L"getPropertyValue('background-color') == 'rgb(255, 0, 0)')", 113 L"getPropertyValue('background-color') == 'rgb(255, 0, 0)')",
114 &styles_injected)); 114 &styles_injected));
115 ASSERT_TRUE(styles_injected); 115 ASSERT_TRUE(styles_injected);
116 } 116 }
117 117
118 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptCSSLocalization) { 118 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptCSSLocalization) {
119 ASSERT_TRUE(StartTestServer()); 119 ASSERT_TRUE(StartTestServer());
120 ASSERT_TRUE(RunExtensionTest("content_scripts/css_l10n")) << message_; 120 ASSERT_TRUE(RunExtensionTest("content_scripts/css_l10n")) << message_;
(...skipping 25 matching lines...) Expand all
146 EXPECT_TRUE(catcher.GetNextResult()); 146 EXPECT_TRUE(catcher.GetNextResult());
147 } 147 }
148 148
149 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptPermissionsApi) { 149 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptPermissionsApi) {
150 RequestPermissionsFunction::SetIgnoreUserGestureForTests(true); 150 RequestPermissionsFunction::SetIgnoreUserGestureForTests(true);
151 RequestPermissionsFunction::SetAutoConfirmForTests(true); 151 RequestPermissionsFunction::SetAutoConfirmForTests(true);
152 host_resolver()->AddRule("*.com", "127.0.0.1"); 152 host_resolver()->AddRule("*.com", "127.0.0.1");
153 ASSERT_TRUE(StartTestServer()); 153 ASSERT_TRUE(StartTestServer());
154 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; 154 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_;
155 } 155 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_app_api_browsertest.cc ('k') | chrome/browser/extensions/extension_browser_event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698