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

Unified Diff: content/browser/background_sync/background_sync_manager_unittest.cc

Issue 1317813003: Revert of [Background Sync] Allow sync manager access from uncontrolled clients (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/background_sync/background_sync_manager_unittest.cc
diff --git a/content/browser/background_sync/background_sync_manager_unittest.cc b/content/browser/background_sync/background_sync_manager_unittest.cc
index b6b73fd40748abd9d60f44281c04676f1c286375..e80881c12ee41f3cca8082c5e93781397412db4b 100644
--- a/content/browser/background_sync/background_sync_manager_unittest.cc
+++ b/content/browser/background_sync/background_sync_manager_unittest.cc
@@ -374,20 +374,7 @@
const BackgroundSyncRegistrationOptions& options) {
bool was_called = false;
background_sync_manager_->Register(
- sw_registration_id, options, true /* requested_from_service_worker */,
- base::Bind(&BackgroundSyncManagerTest::StatusAndRegistrationCallback,
- base::Unretained(this), &was_called));
- base::RunLoop().RunUntilIdle();
- EXPECT_TRUE(was_called);
- return callback_status_ == BACKGROUND_SYNC_STATUS_OK;
- }
-
- bool RegisterFromDocumentWithServiceWorkerId(
- int64 sw_registration_id,
- const BackgroundSyncRegistrationOptions& options) {
- bool was_called = false;
- background_sync_manager_->Register(
- sw_registration_id, options, false /* requested_from_service_worker */,
+ sw_registration_id, options,
base::Bind(&BackgroundSyncManagerTest::StatusAndRegistrationCallback,
base::Unretained(this), &was_called));
base::RunLoop().RunUntilIdle();
@@ -795,7 +782,6 @@
bool get_registration_called = false;
test_background_sync_manager_->Register(
sw_registration_id_1_, sync_options_1_,
- true /* requested_from_service_worker */,
base::Bind(&BackgroundSyncManagerTest::StatusAndRegistrationCallback,
base::Unretained(this), &register_called));
test_background_sync_manager_->Unregister(
@@ -853,7 +839,6 @@
bool callback_called = false;
test_background_sync_manager_->Register(
sw_registration_id_1_, sync_options_2_,
- true /* requested_from_service_worker */,
base::Bind(&BackgroundSyncManagerTest::StatusAndRegistrationCallback,
base::Unretained(this), &callback_called));
@@ -1284,12 +1269,6 @@
EXPECT_FALSE(Register(sync_options_1_));
}
-TEST_F(BackgroundSyncManagerTest, RegisterSucceedsFromUncontrolledWindow) {
- RemoveWindowClients();
- EXPECT_TRUE(RegisterFromDocumentWithServiceWorkerId(sw_registration_id_1_,
- sync_options_1_));
-}
-
TEST_F(BackgroundSyncManagerTest, UnregisterSucceedsWithoutWindow) {
EXPECT_TRUE(Register(sync_options_1_));
RemoveWindowClients();

Powered by Google App Engine
This is Rietveld 408576698