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/unit/chrome_test_suite.h" | 5 #include "chrome/test/unit/chrome_test_suite.h" |
6 | 6 |
7 #include "app/app_paths.h" | 7 #include "app/app_paths.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 break; | 60 break; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 // To avoid depending on external resources and to reduce (if not preclude) | 64 // To avoid depending on external resources and to reduce (if not preclude) |
65 // network interactions from tests, we simulate failure for non-local DNS | 65 // network interactions from tests, we simulate failure for non-local DNS |
66 // queries, rather than perform them. | 66 // queries, rather than perform them. |
67 // If you really need to make an external DNS query, use | 67 // If you really need to make an external DNS query, use |
68 // net::RuleBasedHostResolverProc and its AllowDirectLookup method. | 68 // net::RuleBasedHostResolverProc and its AllowDirectLookup method. |
69 if (!local) { | 69 if (!local) { |
70 DLOG(INFO) << "To avoid external dependencies, simulating failure for " | 70 DVLOG(1) << "To avoid external dependencies, simulating failure for " |
71 << "external DNS lookup of " << host; | 71 "external DNS lookup of " << host; |
72 return net::ERR_NOT_IMPLEMENTED; | 72 return net::ERR_NOT_IMPLEMENTED; |
73 } | 73 } |
74 | 74 |
75 return ResolveUsingPrevious(host, address_family, host_resolver_flags, | 75 return ResolveUsingPrevious(host, address_family, host_resolver_flags, |
76 addrlist, os_error); | 76 addrlist, os_error); |
77 } | 77 } |
78 | 78 |
79 ChromeTestSuite::ChromeTestSuite(int argc, char** argv) | 79 ChromeTestSuite::ChromeTestSuite(int argc, char** argv) |
80 : base::TestSuite(argc, argv), | 80 : base::TestSuite(argc, argv), |
81 stats_table_(NULL) { | 81 stats_table_(NULL) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 delete g_browser_process; | 134 delete g_browser_process; |
135 g_browser_process = NULL; | 135 g_browser_process = NULL; |
136 | 136 |
137 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 137 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
138 base::StatsTable::set_current(NULL); | 138 base::StatsTable::set_current(NULL); |
139 delete stats_table_; | 139 delete stats_table_; |
140 RemoveSharedMemoryFile(stats_filename_); | 140 RemoveSharedMemoryFile(stats_filename_); |
141 | 141 |
142 base::TestSuite::Shutdown(); | 142 base::TestSuite::Shutdown(); |
143 } | 143 } |
OLD | NEW |