Chromium Code Reviews| Index: chrome/browser/sync/test/integration/sync_errors_test.cc |
| diff --git a/chrome/browser/sync/test/integration/sync_errors_test.cc b/chrome/browser/sync/test/integration/sync_errors_test.cc |
| index 95c28cfe5d73b492b00ce2c6c8acc8d424f9f4ed..3f5b8957046f844be5d03925bf96335422a0fd8c 100644 |
| --- a/chrome/browser/sync/test/integration/sync_errors_test.cc |
| +++ b/chrome/browser/sync/test/integration/sync_errors_test.cc |
| @@ -2,7 +2,9 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "chrome/browser/sync/profile_sync_service.h" |
| #include "chrome/browser/sync/profile_sync_service_harness.h" |
| +#include "chrome/browser/sync/protocol/sync_protocol_error.h" |
| #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| #include "chrome/browser/sync/test/integration/sync_test.h" |
| @@ -46,3 +48,59 @@ IN_PROC_BROWSER_TEST_F(SyncErrorTest, TransientErrorTest) { |
| ASSERT_TRUE( |
| GetClient(0)->AwaitExponentialBackoffVerification()); |
| } |
| + |
| +IN_PROC_BROWSER_TEST_F(SyncErrorTest, ActionableErrorTest) { |
| + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| + |
| + const BookmarkNode* node1 = AddFolder(0, 0, L"title1"); |
| + SetTitle(0, node1, L"new_title1"); |
| + ASSERT_TRUE(GetClient(0)->AwaitSyncCycleCompletion("Sync.")); |
| + |
| + browser_sync::SyncProtocolError protocol_error; |
| + protocol_error.error_type = browser_sync::TRANSIENT_ERROR; |
| + protocol_error.action = browser_sync::UPGRADE_CLIENT; |
| + protocol_error.error_description = "Not My Fault"; |
| + protocol_error.url = "www.google.com"; |
| + TriggerSyncError(protocol_error); |
| + |
| + // Now make one more change so we will do another sync. |
| + const BookmarkNode* node2 = AddFolder(0, 0, L"title2"); |
| + SetTitle(0, node2, L"new_title2"); |
| + ASSERT_TRUE( |
| + GetClient(0)->AwaitActionableError()); |
| + ProfileSyncService::Status status = GetClient(0)->GetStatus(); |
| + ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); |
| + ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); |
| + ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); |
| + ASSERT_EQ(status.sync_protocol_error.error_description, |
| + protocol_error.error_description); |
| +} |
| + |
| +IN_PROC_BROWSER_TEST_F(SyncErrorTest, |
| + BirthdayErrorUsingActionableErrorTest) { |
| + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| + |
| + const BookmarkNode* node1 = AddFolder(0, 0, L"title1"); |
| + SetTitle(0, node1, L"new_title1"); |
| + ASSERT_TRUE(GetClient(0)->AwaitSyncCycleCompletion("Sync.")); |
| + |
| + browser_sync::SyncProtocolError protocol_error; |
| + protocol_error.error_type = browser_sync::NOT_MY_BIRTHDAY; |
| + protocol_error.action = browser_sync::DISABLE_SYNC_ON_CLIENT; |
| + protocol_error.error_description = "Not My Fault"; |
| + protocol_error.url = "www.google.com"; |
| + TriggerSyncError(protocol_error); |
| + |
| + // Now make one more change so we will do another sync. |
| + const BookmarkNode* node2 = AddFolder(0, 0, L"title2"); |
| + SetTitle(0, node2, L"new_title2"); |
| + ASSERT_TRUE( |
| + GetClient(0)->AwaitSyncDisabled("Birthday Error.")); |
| + ProfileSyncService::Status status = GetClient(0)->GetStatus(); |
| + ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); |
| + ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); |
| + ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); |
| + ASSERT_EQ(status.sync_protocol_error.error_description, |
| + protocol_error.error_description); |
| +} |
| + |
|
Raghu Simha
2011/09/16 04:01:02
Remove extra blank line.
lipalani1
2011/09/19 18:59:13
Done.
|