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

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 2127373006: Use base::StartWith() in more places when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, resolve conflict Created 4 years, 5 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_linux.cc ('k') | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698