OLD | NEW |
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/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Helper class that checks whether a sync test server is running or not. | 138 // Helper class that checks whether a sync test server is running or not. |
139 class SyncServerStatusChecker : public net::URLFetcherDelegate { | 139 class SyncServerStatusChecker : public net::URLFetcherDelegate { |
140 public: | 140 public: |
141 SyncServerStatusChecker() : running_(false) {} | 141 SyncServerStatusChecker() : running_(false) {} |
142 | 142 |
143 void OnURLFetchComplete(const net::URLFetcher* source) override { | 143 void OnURLFetchComplete(const net::URLFetcher* source) override { |
144 std::string data; | 144 std::string data; |
145 source->GetResponseAsString(&data); | 145 source->GetResponseAsString(&data); |
146 running_ = | 146 running_ = |
147 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && | 147 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && |
148 source->GetResponseCode() == 200 && data.find("ok") == 0); | 148 source->GetResponseCode() == 200 && |
| 149 base::StartsWith(data, "ok", base::CompareCase::SENSITIVE)); |
149 base::MessageLoop::current()->QuitWhenIdle(); | 150 base::MessageLoop::current()->QuitWhenIdle(); |
150 } | 151 } |
151 | 152 |
152 bool running() const { return running_; } | 153 bool running() const { return running_; } |
153 | 154 |
154 private: | 155 private: |
155 bool running_; | 156 bool running_; |
156 }; | 157 }; |
157 | 158 |
158 bool IsEncryptionComplete(const ProfileSyncService* service) { | 159 bool IsEncryptionComplete(const ProfileSyncService* service) { |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 | 1131 |
1131 void SyncTest::TriggerSyncForModelTypes(int index, | 1132 void SyncTest::TriggerSyncForModelTypes(int index, |
1132 syncer::ModelTypeSet model_types) { | 1133 syncer::ModelTypeSet model_types) { |
1133 GetSyncService(index)->TriggerRefresh(model_types); | 1134 GetSyncService(index)->TriggerRefresh(model_types); |
1134 } | 1135 } |
1135 | 1136 |
1136 void SyncTest::SetPreexistingPreferencesFileContents( | 1137 void SyncTest::SetPreexistingPreferencesFileContents( |
1137 const std::string& contents) { | 1138 const std::string& contents) { |
1138 preexisting_preferences_file_contents_ = contents; | 1139 preexisting_preferences_file_contents_ = contents; |
1139 } | 1140 } |
OLD | NEW |