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

Side by Side Diff: content/browser/background_sync/background_sync_service_impl_unittest.cc

Issue 1943963004: Revert of (reland) Move permission.mojom from WebKit/public/platform/ to components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // SetUp helper methods 118 // SetUp helper methods
119 void CreateTestHelper() { 119 void CreateTestHelper() {
120 embedded_worker_helper_.reset( 120 embedded_worker_helper_.reset(
121 new EmbeddedWorkerTestHelper(base::FilePath())); 121 new EmbeddedWorkerTestHelper(base::FilePath()));
122 std::unique_ptr<MockPermissionManager> mock_permission_manager( 122 std::unique_ptr<MockPermissionManager> mock_permission_manager(
123 new testing::NiceMock<MockPermissionManager>()); 123 new testing::NiceMock<MockPermissionManager>());
124 ON_CALL(*mock_permission_manager, 124 ON_CALL(*mock_permission_manager,
125 GetPermissionStatus(PermissionType::BACKGROUND_SYNC, _, _)) 125 GetPermissionStatus(PermissionType::BACKGROUND_SYNC, _, _))
126 .WillByDefault( 126 .WillByDefault(
127 testing::Return(permissions::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, 137 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 EXPECT_EQ(mojom::BackgroundSyncError::NONE, register_error); 255 EXPECT_EQ(mojom::BackgroundSyncError::NONE, register_error);
256 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback, 256 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback,
257 &getregistrations_called, &getregistrations_error, 257 &getregistrations_called, &getregistrations_error,
258 &array_size)); 258 &array_size));
259 EXPECT_TRUE(getregistrations_called); 259 EXPECT_TRUE(getregistrations_called);
260 EXPECT_EQ(mojom::BackgroundSyncError::NONE, getregistrations_error); 260 EXPECT_EQ(mojom::BackgroundSyncError::NONE, getregistrations_error);
261 EXPECT_EQ(1UL, array_size); 261 EXPECT_EQ(1UL, array_size);
262 } 262 }
263 263
264 } // namespace content 264 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698