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

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

Issue 10073011: Fix the optional permissions API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
9 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
10 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
11 #include "chrome/common/extensions/extension.h" 12 #include "chrome/common/extensions/extension.h"
12 #include "chrome/test/base/ui_test_utils.h" 13 #include "chrome/test/base/ui_test_utils.h"
13 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
14 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
15 #include "net/base/mock_host_resolver.h" 16 #include "net/base/mock_host_resolver.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 ui_test_utils::NavigateToURL( 138 ui_test_utils::NavigateToURL(
138 browser(), test_server()->GetURL("events.html")); 139 browser(), test_server()->GetURL("events.html"));
139 140
140 // Navigate to an extension page that will fire the event events.js is 141 // Navigate to an extension page that will fire the event events.js is
141 // listening for. 142 // listening for.
142 ui_test_utils::NavigateToURLWithDisposition( 143 ui_test_utils::NavigateToURLWithDisposition(
143 browser(), extension->GetResourceURL("fire_event.html"), 144 browser(), extension->GetResourceURL("fire_event.html"),
144 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_NONE); 145 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_NONE);
145 EXPECT_TRUE(catcher.GetNextResult()); 146 EXPECT_TRUE(catcher.GetNextResult());
146 } 147 }
148
149 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptPermissionsApi) {
150 RequestPermissionsFunction::SetIgnoreUserGestureForTests(true);
151 RequestPermissionsFunction::SetAutoConfirmForTests(true);
152 host_resolver()->AddRule("*.com", "127.0.0.1");
153 ASSERT_TRUE(StartTestServer());
154 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_;
155 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698