OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/test/live_sync/live_sync_test.h" | 5 #include "chrome/test/live_sync/live_sync_test.h" |
6 | 6 |
7 #include "chrome/browser/profile.h" | 7 #include "chrome/browser/profile.h" |
8 #include "chrome/browser/profile_manager.h" | 8 #include "chrome/browser/profile_manager.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 void LiveSyncTest::TearDown() { | 41 void LiveSyncTest::TearDown() { |
42 // Allow the InProcessBrowserTest framework to perform its tear down. | 42 // Allow the InProcessBrowserTest framework to perform its tear down. |
43 InProcessBrowserTest::TearDown(); | 43 InProcessBrowserTest::TearDown(); |
44 | 44 |
45 // Stop the local test sync server if one was used. | 45 // Stop the local test sync server if one was used. |
46 if (started_local_test_server_) | 46 if (started_local_test_server_) |
47 TearDownLocalTestServer(); | 47 TearDownLocalTestServer(); |
48 } | 48 } |
49 | 49 |
50 // static | 50 // static |
51 Profile* LiveSyncTest::MakeProfile(const FilePath::StringType name) { | 51 Profile* LiveSyncTest::MakeProfile( |
| 52 const FilePath::StringType name) { |
52 FilePath path; | 53 FilePath path; |
53 PathService::Get(chrome::DIR_USER_DATA, &path); | 54 PathService::Get(chrome::DIR_USER_DATA, &path); |
54 return ProfileManager::CreateProfile(path.Append(name)); | 55 return ProfileManager::CreateProfile(path.Append(name)); |
55 } | 56 } |
56 | 57 |
57 Profile* LiveSyncTest::GetProfile(int index) { | 58 Profile* LiveSyncTest::GetProfile(int index) { |
58 EXPECT_FALSE(profiles_.empty()) << "SetupSync() has not yet been called."; | 59 EXPECT_FALSE(profiles_.empty()) << "SetupSync() has not yet been called."; |
59 EXPECT_TRUE((index >= 0) && (index < static_cast<int>(profiles_.size()))) | 60 EXPECT_TRUE((index >= 0) && (index < static_cast<int>(profiles_.size()))) |
60 << "GetProfile(): Index is out of bounds."; | 61 << "GetProfile(): Index is out of bounds."; |
61 return profiles_[index]; | 62 return profiles_[index]; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 CommandLine* cl = CommandLine::ForCurrentProcess(); | 148 CommandLine* cl = CommandLine::ForCurrentProcess(); |
148 cl->AppendSwitchWithValue(switches::kSyncServiceURL, | 149 cl->AppendSwitchWithValue(switches::kSyncServiceURL, |
149 StringPrintf("http://%s:%d/chromiumsync", server_.kHostName, | 150 StringPrintf("http://%s:%d/chromiumsync", server_.kHostName, |
150 server_.kOKHTTPSPort)); | 151 server_.kOKHTTPSPort)); |
151 } | 152 } |
152 | 153 |
153 void LiveSyncTest::TearDownLocalTestServer() { | 154 void LiveSyncTest::TearDownLocalTestServer() { |
154 bool success = server_.Stop(); | 155 bool success = server_.Stop(); |
155 ASSERT_TRUE(success); | 156 ASSERT_TRUE(success); |
156 } | 157 } |
OLD | NEW |