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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 mock_host_resolver_override_.reset(); | 400 mock_host_resolver_override_.reset(); |
401 } | 401 } |
402 | 402 |
403 void SyncTest::ReadPasswordFile() { | 403 void SyncTest::ReadPasswordFile() { |
404 CommandLine* cl = CommandLine::ForCurrentProcess(); | 404 CommandLine* cl = CommandLine::ForCurrentProcess(); |
405 password_file_ = cl->GetSwitchValuePath(switches::kPasswordFileForTest); | 405 password_file_ = cl->GetSwitchValuePath(switches::kPasswordFileForTest); |
406 if (password_file_.empty()) | 406 if (password_file_.empty()) |
407 LOG(FATAL) << "Can't run live server test without specifying --" | 407 LOG(FATAL) << "Can't run live server test without specifying --" |
408 << switches::kPasswordFileForTest << "=<filename>"; | 408 << switches::kPasswordFileForTest << "=<filename>"; |
409 std::string file_contents; | 409 std::string file_contents; |
410 file_util::ReadFileToString(password_file_, &file_contents); | 410 base::ReadFileToString(password_file_, &file_contents); |
411 ASSERT_NE(file_contents, "") << "Password file \"" | 411 ASSERT_NE(file_contents, "") << "Password file \"" |
412 << password_file_.value() << "\" does not exist."; | 412 << password_file_.value() << "\" does not exist."; |
413 std::vector<std::string> tokens; | 413 std::vector<std::string> tokens; |
414 std::string delimiters = "\r\n"; | 414 std::string delimiters = "\r\n"; |
415 Tokenize(file_contents, delimiters, &tokens); | 415 Tokenize(file_contents, delimiters, &tokens); |
416 ASSERT_EQ(2U, tokens.size()) << "Password file \"" | 416 ASSERT_EQ(2U, tokens.size()) << "Password file \"" |
417 << password_file_.value() | 417 << password_file_.value() |
418 << "\" must contain exactly two lines of text."; | 418 << "\" must contain exactly two lines of text."; |
419 username_ = tokens[0]; | 419 username_ = tokens[0]; |
420 password_ = tokens[1]; | 420 password_ = tokens[1]; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 | 832 |
833 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 833 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
834 const net::ProxyConfig& proxy_config) { | 834 const net::ProxyConfig& proxy_config) { |
835 base::WaitableEvent done(false, false); | 835 base::WaitableEvent done(false, false); |
836 BrowserThread::PostTask( | 836 BrowserThread::PostTask( |
837 BrowserThread::IO, FROM_HERE, | 837 BrowserThread::IO, FROM_HERE, |
838 base::Bind(&SetProxyConfigCallback, &done, | 838 base::Bind(&SetProxyConfigCallback, &done, |
839 make_scoped_refptr(context_getter), proxy_config)); | 839 make_scoped_refptr(context_getter), proxy_config)); |
840 done.Wait(); | 840 done.Wait(); |
841 } | 841 } |
OLD | NEW |