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

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

Issue 10912156: Move SessionID, CaptureVisibleTabFunction to WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase atop the extension tab helper change Created 8 years, 3 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/api/extension_action/script_badge_apitest.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 // 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 <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 public: 56 public:
57 ActiveTabTest() 57 ActiveTabTest()
58 : current_channel_(chrome::VersionInfo::CHANNEL_DEV), 58 : current_channel_(chrome::VersionInfo::CHANNEL_DEV),
59 extension(CreateTestExtension("deadbeef", true)), 59 extension(CreateTestExtension("deadbeef", true)),
60 another_extension(CreateTestExtension("feedbeef", true)), 60 another_extension(CreateTestExtension("feedbeef", true)),
61 extension_without_active_tab(CreateTestExtension("badbeef", false)), 61 extension_without_active_tab(CreateTestExtension("badbeef", false)),
62 ui_thread_(BrowserThread::UI, MessageLoop::current()) {} 62 ui_thread_(BrowserThread::UI, MessageLoop::current()) {}
63 63
64 protected: 64 protected:
65 int tab_id() { 65 int tab_id() {
66 return SessionID::IdForTab(tab_contents()); 66 return SessionID::IdForTab(tab_contents()->web_contents());
67 } 67 }
68 68
69 ActiveTabPermissionManager* active_tab_permission_manager() { 69 ActiveTabPermissionManager* active_tab_permission_manager() {
70 return extensions::TabHelper::FromWebContents(web_contents())-> 70 return extensions::TabHelper::FromWebContents(web_contents())->
71 active_tab_permission_manager(); 71 active_tab_permission_manager();
72 } 72 }
73 73
74 bool IsAllowed(const scoped_refptr<const Extension>& extension, 74 bool IsAllowed(const scoped_refptr<const Extension>& extension,
75 const GURL& url) { 75 const GURL& url) {
76 return IsAllowed(extension, url, tab_id()); 76 return IsAllowed(extension, url, tab_id());
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 Reload(); 314 Reload();
315 315
316 EXPECT_FALSE(IsAllowed(extension, google, tab_id())); 316 EXPECT_FALSE(IsAllowed(extension, google, tab_id()));
317 EXPECT_FALSE(IsAllowed(extension, google_h1, tab_id())); 317 EXPECT_FALSE(IsAllowed(extension, google_h1, tab_id()));
318 EXPECT_FALSE(IsAllowed(extension, chromium, tab_id())); 318 EXPECT_FALSE(IsAllowed(extension, chromium, tab_id()));
319 EXPECT_FALSE(IsAllowed(extension, chromium_h1, tab_id())); 319 EXPECT_FALSE(IsAllowed(extension, chromium_h1, tab_id()));
320 } 320 }
321 321
322 } // namespace 322 } // namespace
323 } // namespace extensions 323 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/extension_action/script_badge_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698