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

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

Issue 1486403002: Mojo-ifying chrome://version. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 5 years 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
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 #include <utility> 6 #include <utility>
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 Reload(); 356 Reload();
357 357
358 EXPECT_FALSE(IsAllowed(extension, google)); 358 EXPECT_FALSE(IsAllowed(extension, google));
359 EXPECT_FALSE(IsAllowed(extension, google_h1)); 359 EXPECT_FALSE(IsAllowed(extension, google_h1));
360 EXPECT_FALSE(IsAllowed(extension, chromium)); 360 EXPECT_FALSE(IsAllowed(extension, chromium));
361 EXPECT_FALSE(IsAllowed(extension, chromium_h1)); 361 EXPECT_FALSE(IsAllowed(extension, chromium_h1));
362 } 362 }
363 363
364 TEST_F(ActiveTabTest, ChromeUrlGrants) { 364 TEST_F(ActiveTabTest, ChromeUrlGrants) {
365 GURL internal("chrome://version"); 365 GURL internal("chrome://about");
366 NavigateAndCommit(internal); 366 NavigateAndCommit(internal);
367 active_tab_permission_granter()->GrantIfRequested( 367 active_tab_permission_granter()->GrantIfRequested(
368 extension_with_tab_capture.get()); 368 extension_with_tab_capture.get());
369 // Do not grant tabs/hosts permissions for tab. 369 // Do not grant tabs/hosts permissions for tab.
370 EXPECT_TRUE(IsAllowed(extension_with_tab_capture, internal, 370 EXPECT_TRUE(IsAllowed(extension_with_tab_capture, internal,
371 PERMITTED_CAPTURE_ONLY)); 371 PERMITTED_CAPTURE_ONLY));
372 const PermissionsData* permissions_data = 372 const PermissionsData* permissions_data =
373 extension_with_tab_capture->permissions_data(); 373 extension_with_tab_capture->permissions_data();
374 EXPECT_TRUE(permissions_data->HasAPIPermissionForTab( 374 EXPECT_TRUE(permissions_data->HasAPIPermissionForTab(
375 tab_id(), APIPermission::kTabCaptureForTab)); 375 tab_id(), APIPermission::kTabCaptureForTab));
376 376
377 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1)); 377 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1));
378 EXPECT_FALSE(permissions_data->HasAPIPermissionForTab( 378 EXPECT_FALSE(permissions_data->HasAPIPermissionForTab(
379 tab_id() + 1, APIPermission::kTabCaptureForTab)); 379 tab_id() + 1, APIPermission::kTabCaptureForTab));
380 } 380 }
381 381
382 } // namespace 382 } // namespace
383 } // namespace extensions 383 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698