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

Side by Side Diff: components/offline_pages/content/background_loader/background_loader_contents_unittest.cc

Issue 2521793003: Fix WebContentsDelegate::ShouldCreateWebContents implementations. (Closed)
Patch Set: Rename in MaybeCreateBackgroundContents Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/offline_pages/content/background_loader/background_loader_c ontents.h" 5 #include "components/offline_pages/content/background_loader/background_loader_c ontents.h"
6 6
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 contents()->CanDownload( 89 contents()->CanDownload(
90 GURL::EmptyGURL(), std::string(), 90 GURL::EmptyGURL(), std::string(),
91 base::Bind(&BackgroundLoaderContentsTest::DownloadCallback, 91 base::Bind(&BackgroundLoaderContentsTest::DownloadCallback,
92 base::Unretained(this))); 92 base::Unretained(this)));
93 WaitForSignal(); 93 WaitForSignal();
94 ASSERT_FALSE(download()); 94 ASSERT_FALSE(download());
95 } 95 }
96 96
97 TEST_F(BackgroundLoaderContentsTest, ShouldNotCreateWebContents) { 97 TEST_F(BackgroundLoaderContentsTest, ShouldNotCreateWebContents) {
98 ASSERT_FALSE(contents()->ShouldCreateWebContents( 98 ASSERT_FALSE(contents()->ShouldCreateWebContents(
99 nullptr /* contents */, 0 /* route_id */, 0 /* main_frame_route_id */, 99 nullptr /* contents */, nullptr /* source_site_instance */,
100 0 /* route_id */, 0 /* main_frame_route_id */,
100 0 /* main_frame_widget_route_id */, 101 0 /* main_frame_widget_route_id */,
101 WINDOW_CONTAINER_TYPE_NORMAL /* window_container_type */, 102 WINDOW_CONTAINER_TYPE_NORMAL /* window_container_type */,
102 "foo" /* frame_name */, GURL::EmptyGURL() /* target_url */, 103 GURL() /* opener_url */, "foo" /* frame_name */,
103 "bar" /* partition_id */, nullptr /* session_storage_namespace */)); 104 GURL::EmptyGURL() /* target_url */, "bar" /* partition_id */,
105 nullptr /* session_storage_namespace */));
104 } 106 }
105 107
106 TEST_F(BackgroundLoaderContentsTest, ShouldNotAddNewContents) { 108 TEST_F(BackgroundLoaderContentsTest, ShouldNotAddNewContents) {
107 bool blocked; 109 bool blocked;
108 contents()->AddNewContents( 110 contents()->AddNewContents(
109 nullptr /* source */, nullptr /* new_contents */, 111 nullptr /* source */, nullptr /* new_contents */,
110 WindowOpenDisposition::CURRENT_TAB /* disposition */, 112 WindowOpenDisposition::CURRENT_TAB /* disposition */,
111 gfx::Rect() /* initial_rect */, false /* user_gesture */, 113 gfx::Rect() /* initial_rect */, false /* user_gesture */,
112 &blocked /* was_blocked */); 114 &blocked /* was_blocked */);
113 ASSERT_TRUE(blocked); 115 ASSERT_TRUE(blocked);
(...skipping 24 matching lines...) Expand all
138 ASSERT_EQ(nullptr, media_stream_ui()); 140 ASSERT_EQ(nullptr, media_stream_ui());
139 } 141 }
140 142
141 TEST_F(BackgroundLoaderContentsTest, CheckMediaAccessPermissionFalse) { 143 TEST_F(BackgroundLoaderContentsTest, CheckMediaAccessPermissionFalse) {
142 ASSERT_FALSE(contents()->CheckMediaAccessPermission( 144 ASSERT_FALSE(contents()->CheckMediaAccessPermission(
143 nullptr /* contents */, GURL::EmptyGURL() /* security_origin */, 145 nullptr /* contents */, GURL::EmptyGURL() /* security_origin */,
144 content::MediaStreamType::MEDIA_TAB_VIDEO_CAPTURE /* type */)); 146 content::MediaStreamType::MEDIA_TAB_VIDEO_CAPTURE /* type */));
145 } 147 }
146 148
147 } // namespace background_loader 149 } // namespace background_loader
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698