| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 const Extension* extension = | 322 const Extension* extension = |
| 323 LoadAndReplyWhenSatisfied(SYNC, | 323 LoadAndReplyWhenSatisfied(SYNC, |
| 324 "assertNoNotifications", "assertNoNotifications", "split_incognito"); | 324 "assertNoNotifications", "assertNoNotifications", "split_incognito"); |
| 325 const std::string& extension_id = extension->id(); | 325 const std::string& extension_id = extension->id(); |
| 326 | 326 |
| 327 syncer::FakeSyncChangeProcessor sync_processor; | 327 syncer::FakeSyncChangeProcessor sync_processor; |
| 328 InitSync(&sync_processor); | 328 InitSync(&sync_processor); |
| 329 | 329 |
| 330 // Set "foo" to "bar" via sync. | 330 // Set "foo" to "bar" via sync. |
| 331 syncer::SyncChangeList sync_changes; | 331 syncer::SyncChangeList sync_changes; |
| 332 base::StringValue bar("bar"); | 332 base::Value bar("bar"); |
| 333 sync_changes.push_back(settings_sync_util::CreateAdd( | 333 sync_changes.push_back(settings_sync_util::CreateAdd( |
| 334 extension_id, "foo", bar, kModelType)); | 334 extension_id, "foo", bar, kModelType)); |
| 335 SendChanges(sync_changes); | 335 SendChanges(sync_changes); |
| 336 | 336 |
| 337 ReplyWhenSatisfied(SYNC, | 337 ReplyWhenSatisfied(SYNC, |
| 338 "assertAddFooNotification", "assertAddFooNotification"); | 338 "assertAddFooNotification", "assertAddFooNotification"); |
| 339 ReplyWhenSatisfied(SYNC, "clearNotifications", "clearNotifications"); | 339 ReplyWhenSatisfied(SYNC, "clearNotifications", "clearNotifications"); |
| 340 | 340 |
| 341 // Remove "foo" via sync. | 341 // Remove "foo" via sync. |
| 342 sync_changes.clear(); | 342 sync_changes.clear(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 367 const Extension* extension = | 367 const Extension* extension = |
| 368 LoadAndReplyWhenSatisfied(LOCAL, | 368 LoadAndReplyWhenSatisfied(LOCAL, |
| 369 "assertNoNotifications", "assertNoNotifications", "split_incognito"); | 369 "assertNoNotifications", "assertNoNotifications", "split_incognito"); |
| 370 const std::string& extension_id = extension->id(); | 370 const std::string& extension_id = extension->id(); |
| 371 | 371 |
| 372 syncer::FakeSyncChangeProcessor sync_processor; | 372 syncer::FakeSyncChangeProcessor sync_processor; |
| 373 InitSync(&sync_processor); | 373 InitSync(&sync_processor); |
| 374 | 374 |
| 375 // Set "foo" to "bar" via sync. | 375 // Set "foo" to "bar" via sync. |
| 376 syncer::SyncChangeList sync_changes; | 376 syncer::SyncChangeList sync_changes; |
| 377 base::StringValue bar("bar"); | 377 base::Value bar("bar"); |
| 378 sync_changes.push_back(settings_sync_util::CreateAdd( | 378 sync_changes.push_back(settings_sync_util::CreateAdd( |
| 379 extension_id, "foo", bar, kModelType)); | 379 extension_id, "foo", bar, kModelType)); |
| 380 SendChanges(sync_changes); | 380 SendChanges(sync_changes); |
| 381 | 381 |
| 382 ReplyWhenSatisfied(LOCAL, "assertNoNotifications", "assertNoNotifications"); | 382 ReplyWhenSatisfied(LOCAL, "assertNoNotifications", "assertNoNotifications"); |
| 383 | 383 |
| 384 // Remove "foo" via sync. | 384 // Remove "foo" via sync. |
| 385 sync_changes.clear(); | 385 sync_changes.clear(); |
| 386 sync_changes.push_back(settings_sync_util::CreateDelete( | 386 sync_changes.push_back(settings_sync_util::CreateDelete( |
| 387 extension_id, "foo", kModelType)); | 387 extension_id, "foo", kModelType)); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 // Disable the 'managed' namespace. | 564 // Disable the 'managed' namespace. |
| 565 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); | 565 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); |
| 566 frontend->DisableStorageForTesting(MANAGED); | 566 frontend->DisableStorageForTesting(MANAGED); |
| 567 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 567 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
| 568 // Now run the extension. | 568 // Now run the extension. |
| 569 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 569 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
| 570 << message_; | 570 << message_; |
| 571 } | 571 } |
| 572 | 572 |
| 573 } // namespace extensions | 573 } // namespace extensions |
| OLD | NEW |