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

Side by Side Diff: chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc

Issue 9794009: Use about:blank as the failback URL if the filter denies a navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | content/browser/renderer_host/render_view_host_impl.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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 404
405 EXPECT_EQ(CONTENT_SETTING_ALLOW, 405 EXPECT_EQ(CONTENT_SETTING_ALLOW,
406 profile()->GetHostContentSettingsMap()->GetContentSetting( 406 profile()->GetHostContentSettingsMap()->GetContentSetting(
407 requesting_frame_1, 407 requesting_frame_1,
408 requesting_frame_0, 408 requesting_frame_0,
409 CONTENT_SETTINGS_TYPE_GEOLOCATION, 409 CONTENT_SETTINGS_TYPE_GEOLOCATION,
410 std::string())); 410 std::string()));
411 } 411 }
412 412
413 TEST_F(GeolocationPermissionContextTests, InvalidURL) { 413 TEST_F(GeolocationPermissionContextTests, InvalidURL) {
414 GURL invalid_embedder; 414 GURL invalid_embedder("about:blank");
415 GURL requesting_frame("about:blank"); 415 GURL requesting_frame;
416 NavigateAndCommit(invalid_embedder); 416 NavigateAndCommit(invalid_embedder);
417 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count()); 417 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count());
418 RequestGeolocationPermission( 418 RequestGeolocationPermission(
419 process_id(), render_id(), bridge_id(), requesting_frame); 419 process_id(), render_id(), bridge_id(), requesting_frame);
420 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count()); 420 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count());
421 CheckPermissionMessageSent(bridge_id(), false); 421 CheckPermissionMessageSent(bridge_id(), false);
422 } 422 }
423 423
424 TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) { 424 TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) {
425 GURL url_a("http://www.example.com/geolocation"); 425 GURL url_a("http://www.example.com/geolocation");
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 ASSERT_FALSE(infobar_0->ShouldExpire(details)); 591 ASSERT_FALSE(infobar_0->ShouldExpire(details));
592 // Commit the "GoBack()" above, and ensure the infobar is now expired. 592 // Commit the "GoBack()" above, and ensure the infobar is now expired.
593 contents()->CommitPendingNavigation(); 593 contents()->CommitPendingNavigation();
594 details.entry = contents()->GetController().GetLastCommittedEntry(); 594 details.entry = contents()->GetController().GetLastCommittedEntry();
595 ASSERT_TRUE(infobar_0->ShouldExpire(details)); 595 ASSERT_TRUE(infobar_0->ShouldExpire(details));
596 596
597 // Delete the tab contents. 597 // Delete the tab contents.
598 DeleteContents(); 598 DeleteContents();
599 infobar_0->InfoBarClosed(); 599 infobar_0->InfoBarClosed();
600 } 600 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698