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

Side by Side Diff: components/sync/driver/sync_util_unittest.cc

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « components/sync/driver/sync_util.cc ('k') | components/sync/driver/system_encryptor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/sync/driver/sync_util.h" 5 #include "components/sync/driver/sync_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "components/sync/driver/sync_driver_switches.h" 9 #include "components/sync/driver/sync_driver_switches.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "url/gurl.h" 11 #include "url/gurl.h"
12 12
13 namespace syncer { 13 namespace {
14 14
15 TEST(SyncUtilTest, GetSyncServiceURLWithoutCommandLineSwitch) { 15 TEST(SyncUtilTest, GetSyncServiceURLWithoutCommandLineSwitch) {
16 // If the command line is not set the url is one of two constants chosen based 16 // If the command line is not set the url is one of two constants chosen based
17 // on the channel (e.g. beta). 17 // on the channel (e.g. beta).
18 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); 18 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
19 std::string url = 19 std::string url =
20 GetSyncServiceURL(command_line, version_info::Channel::BETA).spec(); 20 GetSyncServiceURL(command_line, version_info::Channel::BETA).spec();
21 ASSERT_TRUE(internal::kSyncServerUrl == url || 21 ASSERT_TRUE(internal::kSyncServerUrl == url ||
22 internal::kSyncDevServerUrl == url); 22 internal::kSyncDevServerUrl == url);
23 } 23 }
(...skipping 17 matching lines...) Expand all
41 internal::kSyncDevServerUrl == url); 41 internal::kSyncDevServerUrl == url);
42 } 42 }
43 43
44 TEST(SyncUtilTest, FormatUserAgentForSync) { 44 TEST(SyncUtilTest, FormatUserAgentForSync) {
45 std::string user_agent = 45 std::string user_agent =
46 internal::FormatUserAgentForSync("TEST", version_info::Channel::UNKNOWN); 46 internal::FormatUserAgentForSync("TEST", version_info::Channel::UNKNOWN);
47 ASSERT_TRUE(base::StartsWith(user_agent, "Chrome TEST", 47 ASSERT_TRUE(base::StartsWith(user_agent, "Chrome TEST",
48 base::CompareCase::SENSITIVE)); 48 base::CompareCase::SENSITIVE));
49 } 49 }
50 50
51 } // namespace syncer 51 } // namespace
OLDNEW
« no previous file with comments | « components/sync/driver/sync_util.cc ('k') | components/sync/driver/system_encryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698