OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/background_sync/background_sync_service_impl.h" | 5 #include "content/browser/background_sync/background_sync_service_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 .WillByDefault( | 126 .WillByDefault( |
127 testing::Return(blink::mojom::PermissionStatus::GRANTED)); | 127 testing::Return(blink::mojom::PermissionStatus::GRANTED)); |
128 embedded_worker_helper_->browser_context()->SetPermissionManager( | 128 embedded_worker_helper_->browser_context()->SetPermissionManager( |
129 std::move(mock_permission_manager)); | 129 std::move(mock_permission_manager)); |
130 } | 130 } |
131 | 131 |
132 void CreateStoragePartition() { | 132 void CreateStoragePartition() { |
133 // Creates a StoragePartition so that the BackgroundSyncManager can | 133 // Creates a StoragePartition so that the BackgroundSyncManager can |
134 // use it to access the BrowserContext. | 134 // use it to access the BrowserContext. |
135 storage_partition_impl_.reset(new StoragePartitionImpl( | 135 storage_partition_impl_.reset(new StoragePartitionImpl( |
136 embedded_worker_helper_->browser_context(), base::FilePath(), nullptr)); | 136 embedded_worker_helper_->browser_context(), base::FilePath(), nullptr, |
| 137 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, |
| 138 nullptr, nullptr, nullptr, nullptr, nullptr)); |
137 embedded_worker_helper_->context_wrapper()->set_storage_partition( | 139 embedded_worker_helper_->context_wrapper()->set_storage_partition( |
138 storage_partition_impl_.get()); | 140 storage_partition_impl_.get()); |
139 } | 141 } |
140 | 142 |
141 void CreateBackgroundSyncContext() { | 143 void CreateBackgroundSyncContext() { |
142 // Registering for background sync includes a check for having a same-origin | 144 // Registering for background sync includes a check for having a same-origin |
143 // main frame. Use a test context that allows control over that check. | 145 // main frame. Use a test context that allows control over that check. |
144 background_sync_context_ = new TestBackgroundSyncContext(); | 146 background_sync_context_ = new TestBackgroundSyncContext(); |
145 background_sync_context_->Init(embedded_worker_helper_->context_wrapper()); | 147 background_sync_context_->Init(embedded_worker_helper_->context_wrapper()); |
146 | 148 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, register_error); | 256 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, register_error); |
255 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback, | 257 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback, |
256 &getregistrations_called, &getregistrations_error, | 258 &getregistrations_called, &getregistrations_error, |
257 &array_size)); | 259 &array_size)); |
258 EXPECT_TRUE(getregistrations_called); | 260 EXPECT_TRUE(getregistrations_called); |
259 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, getregistrations_error); | 261 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, getregistrations_error); |
260 EXPECT_EQ(1UL, array_size); | 262 EXPECT_EQ(1UL, array_size); |
261 } | 263 } |
262 | 264 |
263 } // namespace content | 265 } // namespace content |
OLD | NEW |