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

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

Issue 10815028: Make ActiveTabPermissionManager also grant the tabs permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 8 years, 4 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/browser/extensions/active_tab_permission_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/logging.h"
6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/extension_system.h"
9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_tabstrip.h"
11 #include "chrome/common/extensions/extension.h"
12 #include "chrome/test/base/ui_test_utils.h"
13
14 namespace extensions {
15 namespace {
16
17 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ActiveTab) {
18 ASSERT_TRUE(StartTestServer());
19
20 const Extension* extension =
21 LoadExtension(test_data_dir_.AppendASCII("active_tab"));
22 ASSERT_TRUE(extension);
23
24 ExtensionService* service =
25 ExtensionSystem::Get(browser()->profile())->extension_service();
26
27 // Shouldn't be initially granted based on activeTab.
28 {
29 ResultCatcher catcher;
30 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("page.html"));
31 EXPECT_TRUE(catcher.GetNextResult()) << message_;
32 }
33
34 // Granting to the extension should give it access to page.html.
35 {
36 ResultCatcher catcher;
37 service->toolbar_model()->ExecuteBrowserAction(extension, browser(), NULL);
38 EXPECT_TRUE(catcher.GetNextResult()) << message_;
39 }
40
41 // Changing page should go back to it not having access.
42 {
43 ResultCatcher catcher;
44 ui_test_utils::NavigateToURL(browser(),
45 test_server()->GetURL("final_page.html"));
46 EXPECT_TRUE(catcher.GetNextResult()) << message_;
47 }
48 }
49
50 } // namespace
51 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/active_tab_permission_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698