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

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

Issue 2882513005: Propagate opener to BackgroundsContents. (Closed)
Patch Set: . Created 3 years, 7 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
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 TEST_F(BackgroundLoaderContentsTest, CannotDownload) { 88 TEST_F(BackgroundLoaderContentsTest, CannotDownload) {
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) {
ncarter (slow) 2017/05/17 20:45:27 Could you also add a few lines to app_background_p
Łukasz Anforowicz 2017/05/22 17:19:27 Good idea. Done.
98 ASSERT_FALSE(contents()->ShouldCreateWebContents( 98 ASSERT_FALSE(contents()->ShouldCreateWebContents(
99 nullptr /* contents */, nullptr /* source_site_instance */, 99 nullptr /* contents */, nullptr /* opener */,
100 0 /* route_id */, 0 /* main_frame_route_id */, 100 nullptr /* source_site_instance */, 0 /* route_id */,
101 0 /* main_frame_widget_route_id */, 101 0 /* main_frame_route_id */, 0 /* main_frame_widget_route_id */,
102 content::mojom::WindowContainerType::NORMAL /* window_container_type */, 102 content::mojom::WindowContainerType::NORMAL /* window_container_type */,
103 GURL() /* opener_url */, "foo" /* frame_name */, 103 GURL() /* opener_url */, "foo" /* frame_name */,
104 GURL::EmptyGURL() /* target_url */, "bar" /* partition_id */, 104 GURL::EmptyGURL() /* target_url */, "bar" /* partition_id */,
105 nullptr /* session_storage_namespace */)); 105 nullptr /* session_storage_namespace */));
106 } 106 }
107 107
108 TEST_F(BackgroundLoaderContentsTest, ShouldNotAddNewContents) { 108 TEST_F(BackgroundLoaderContentsTest, ShouldNotAddNewContents) {
109 bool blocked; 109 bool blocked;
110 contents()->AddNewContents( 110 contents()->AddNewContents(
111 nullptr /* source */, nullptr /* new_contents */, 111 nullptr /* source */, nullptr /* new_contents */,
(...skipping 28 matching lines...) Expand all
140 ASSERT_EQ(nullptr, media_stream_ui()); 140 ASSERT_EQ(nullptr, media_stream_ui());
141 } 141 }
142 142
143 TEST_F(BackgroundLoaderContentsTest, CheckMediaAccessPermissionFalse) { 143 TEST_F(BackgroundLoaderContentsTest, CheckMediaAccessPermissionFalse) {
144 ASSERT_FALSE(contents()->CheckMediaAccessPermission( 144 ASSERT_FALSE(contents()->CheckMediaAccessPermission(
145 nullptr /* contents */, GURL::EmptyGURL() /* security_origin */, 145 nullptr /* contents */, GURL::EmptyGURL() /* security_origin */,
146 content::MediaStreamType::MEDIA_TAB_VIDEO_CAPTURE /* type */)); 146 content::MediaStreamType::MEDIA_TAB_VIDEO_CAPTURE /* type */));
147 } 147 }
148 148
149 } // namespace background_loader 149 } // namespace background_loader
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698