OLD | NEW |
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 Loading... |
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 */, 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 Loading... |
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 |
OLD | NEW |