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

Unified Diff: chrome/browser/sync/profile_sync_service_factory_unittest.cc

Issue 902443002: Add unit tests for the 'disable-sync' flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_factory_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_factory_unittest.cc b/chrome/browser/sync/profile_sync_service_factory_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e3c2da1ae595c8578ec2bedce3cc2fd1bb7ab7cd
--- /dev/null
+++ b/chrome/browser/sync/profile_sync_service_factory_unittest.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/test/base/testing_profile.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class ProfileSyncServiceFactoryTest : public testing::Test {
+ protected:
+ ProfileSyncServiceFactoryTest() {}
+
+ void SetUp() override {
+ profile_.reset(new TestingProfile());
+ }
+
+ scoped_ptr<Profile> profile_;
+};
+
+// Verify that the disable sync flag disables creation of the sync service.
+TEST_F(ProfileSyncServiceFactoryTest, DisableSyncFlag) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync);
+ EXPECT_EQ(nullptr, ProfileSyncServiceFactory::GetForProfile(profile_.get()));
+}
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698