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

Side by Side Diff: chrome/browser/themes/theme_syncable_service_unittest.cc

Issue 388003002: Sync: Display non-severe errors on about:sync in gray color rather than red. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing unit test, added extra test case, addressed CR feedback. Created 6 years, 5 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 (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 "chrome/browser/themes/theme_syncable_service.h" 5 #include "chrome/browser/themes/theme_syncable_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 // Change current theme to custom theme and notify theme_sync_service_. 528 // Change current theme to custom theme and notify theme_sync_service_.
529 // No change is output because sync has stopped. 529 // No change is output because sync has stopped.
530 fake_theme_service_->SetTheme(theme_extension_.get()); 530 fake_theme_service_->SetTheme(theme_extension_.get());
531 theme_sync_service_->OnThemeChange(); 531 theme_sync_service_->OnThemeChange();
532 EXPECT_EQ(0u, changes.size()); 532 EXPECT_EQ(0u, changes.size());
533 533
534 // ProcessSyncChanges() should return error when sync has stopped. 534 // ProcessSyncChanges() should return error when sync has stopped.
535 error = theme_sync_service_->ProcessSyncChanges(FROM_HERE, changes); 535 error = theme_sync_service_->ProcessSyncChanges(FROM_HERE, changes);
536 EXPECT_TRUE(error.IsSet()); 536 EXPECT_TRUE(error.IsSet());
537 EXPECT_EQ(syncer::THEMES, error.model_type()); 537 EXPECT_EQ(syncer::THEMES, error.model_type());
538 EXPECT_EQ("datatype error was encountered: Theme syncable service is not " 538 EXPECT_EQ("Theme syncable service is not started.", error.message());
539 "started.",
540 error.message());
541 } 539 }
542 540
543 TEST_F(ThemeSyncableServiceTest, RestoreSystemThemeBitWhenChangeToCustomTheme) { 541 TEST_F(ThemeSyncableServiceTest, RestoreSystemThemeBitWhenChangeToCustomTheme) {
544 // Initialize to use system theme. 542 // Initialize to use system theme.
545 fake_theme_service_->UseDefaultTheme(); 543 fake_theme_service_->UseDefaultTheme();
546 sync_pb::ThemeSpecifics theme_specifics; 544 sync_pb::ThemeSpecifics theme_specifics;
547 theme_specifics.set_use_system_theme_by_default(true); 545 theme_specifics.set_use_system_theme_by_default(true);
548 syncer::SyncError error = 546 syncer::SyncError error =
549 theme_sync_service_ 547 theme_sync_service_
550 ->MergeDataAndStartSyncing( 548 ->MergeDataAndStartSyncing(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 654
657 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { 655 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) {
658 // Set up theme service to use custom theme that was installed by policy. 656 // Set up theme service to use custom theme that was installed by policy.
659 fake_theme_service_->SetTheme(theme_extension_.get()); 657 fake_theme_service_->SetTheme(theme_extension_.get());
660 658
661 syncer::SyncDataList data_list = 659 syncer::SyncDataList data_list =
662 theme_sync_service_->GetAllSyncData(syncer::THEMES); 660 theme_sync_service_->GetAllSyncData(syncer::THEMES);
663 661
664 ASSERT_EQ(0u, data_list.size()); 662 ASSERT_EQ(0u, data_list.size());
665 } 663 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_mock.h ('k') | components/sync_driver/failed_data_types_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698