| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // static | 73 // static |
| 74 const BookmarkNode* LiveSyncTest::GetByUniqueURL(BookmarkModel* m, | 74 const BookmarkNode* LiveSyncTest::GetByUniqueURL(BookmarkModel* m, |
| 75 const GURL& url) { | 75 const GURL& url) { |
| 76 std::vector<const BookmarkNode*> nodes; | 76 std::vector<const BookmarkNode*> nodes; |
| 77 m->GetNodesByURL(url, &nodes); | 77 m->GetNodesByURL(url, &nodes); |
| 78 EXPECT_EQ(1U, nodes.size()); | 78 EXPECT_EQ(1U, nodes.size()); |
| 79 return nodes[0]; | 79 return nodes[0]; |
| 80 } | 80 } |
| 81 | 81 |
| 82 // static | 82 // static |
| 83 Profile* LiveSyncTest::MakeProfile(const std::wstring& name) { | 83 Profile* LiveSyncTest::MakeProfile(const FilePath::CharType* name) { |
| 84 FilePath path; | 84 FilePath path; |
| 85 PathService::Get(chrome::DIR_USER_DATA, &path); | 85 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 86 path.Append(FilePath::FromWStringHack(name)); | 86 |
| 87 return ProfileManager::CreateProfile(path); | 87 return ProfileManager::CreateProfile(path.Append(name)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void LiveSyncTest::SetUpInProcessBrowserTestFixture() { | 90 void LiveSyncTest::SetUpInProcessBrowserTestFixture() { |
| 91 // We don't take a reference to |resolver|, but mock_host_resolver_override_ | 91 // We don't take a reference to |resolver|, but mock_host_resolver_override_ |
| 92 // does, so effectively assumes ownership. | 92 // does, so effectively assumes ownership. |
| 93 net::RuleBasedHostResolverProc* resolver = | 93 net::RuleBasedHostResolverProc* resolver = |
| 94 new net::RuleBasedHostResolverProc(host_resolver()); | 94 new net::RuleBasedHostResolverProc(host_resolver()); |
| 95 resolver->AllowDirectLookup("*.google.com"); | 95 resolver->AllowDirectLookup("*.google.com"); |
| 96 // Allow direct lookup of thawte.com. On Linux, we use Chromium's nss | 96 // Allow direct lookup of thawte.com. On Linux, we use Chromium's nss |
| 97 // implementation which uses ocsp.thawte.com for certificate verification. | 97 // implementation which uses ocsp.thawte.com for certificate verification. |
| 98 // Without this, running the test case on Linux causes an error as we make an | 98 // Without this, running the test case on Linux causes an error as we make an |
| 99 // external DNS lookup of "ocsp.thawte.com". | 99 // external DNS lookup of "ocsp.thawte.com". |
| 100 resolver->AllowDirectLookup("*.thawte.com"); | 100 resolver->AllowDirectLookup("*.thawte.com"); |
| 101 mock_host_resolver_override_.reset( | 101 mock_host_resolver_override_.reset( |
| 102 new net::ScopedDefaultHostResolverProc(resolver)); | 102 new net::ScopedDefaultHostResolverProc(resolver)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void LiveSyncTest::TearDownInProcessBrowserTestFixture() { | 105 void LiveSyncTest::TearDownInProcessBrowserTestFixture() { |
| 106 mock_host_resolver_override_.reset(); | 106 mock_host_resolver_override_.reset(); |
| 107 } | 107 } |
| OLD | NEW |