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( | 51 Profile* LiveSyncTest::MakeProfile(const FilePath::StringType name) { |
52 const FilePath::StringType name) { | |
53 FilePath path; | 52 FilePath path; |
54 PathService::Get(chrome::DIR_USER_DATA, &path); | 53 PathService::Get(chrome::DIR_USER_DATA, &path); |
55 return ProfileManager::CreateProfile(path.Append(name)); | 54 return ProfileManager::CreateProfile(path.Append(name)); |
56 } | 55 } |
57 | 56 |
58 Profile* LiveSyncTest::GetProfile(int index) { | 57 Profile* LiveSyncTest::GetProfile(int index) { |
59 EXPECT_FALSE(profiles_.empty()) << "SetupSync() has not yet been called."; | 58 EXPECT_FALSE(profiles_.empty()) << "SetupSync() has not yet been called."; |
60 EXPECT_TRUE((index >= 0) && (index < static_cast<int>(profiles_.size()))) | 59 EXPECT_TRUE((index >= 0) && (index < static_cast<int>(profiles_.size()))) |
61 << "GetProfile(): Index is out of bounds."; | 60 << "GetProfile(): Index is out of bounds."; |
62 return profiles_[index]; | 61 return profiles_[index]; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 CommandLine* cl = CommandLine::ForCurrentProcess(); | 147 CommandLine* cl = CommandLine::ForCurrentProcess(); |
149 cl->AppendSwitchWithValue(switches::kSyncServiceURL, | 148 cl->AppendSwitchWithValue(switches::kSyncServiceURL, |
150 StringPrintf("http://%s:%d/chromiumsync", server_.kHostName, | 149 StringPrintf("http://%s:%d/chromiumsync", server_.kHostName, |
151 server_.kOKHTTPSPort)); | 150 server_.kOKHTTPSPort)); |
152 } | 151 } |
153 | 152 |
154 void LiveSyncTest::TearDownLocalTestServer() { | 153 void LiveSyncTest::TearDownLocalTestServer() { |
155 bool success = server_.Stop(); | 154 bool success = server_.Stop(); |
156 ASSERT_TRUE(success); | 155 ASSERT_TRUE(success); |
157 } | 156 } |
OLD | NEW |