| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/profile_resetter/profile_resetter.h" | 5 #include "chrome/browser/profile_resetter/profile_resetter.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 private: | 232 private: |
| 233 std::unique_ptr<net::FakeURLFetcher> CreateFakeURLFetcher( | 233 std::unique_ptr<net::FakeURLFetcher> CreateFakeURLFetcher( |
| 234 const GURL& url, | 234 const GURL& url, |
| 235 net::URLFetcherDelegate* fetcher_delegate, | 235 net::URLFetcherDelegate* fetcher_delegate, |
| 236 const std::string& response_data, | 236 const std::string& response_data, |
| 237 net::HttpStatusCode response_code, | 237 net::HttpStatusCode response_code, |
| 238 net::URLRequestStatus::Status status); | 238 net::URLRequestStatus::Status status); |
| 239 | 239 |
| 240 MOCK_METHOD0(Callback, void(void)); | 240 MOCK_METHOD0(Callback, void(void)); |
| 241 | 241 |
| 242 base::MessageLoopForIO loop_; | 242 content::TestBrowserThreadBundle test_browser_thread_bundle_; |
| 243 content::TestBrowserThread ui_thread_; | |
| 244 content::TestBrowserThread io_thread_; | |
| 245 URLFetcherRequestListener request_listener_; | 243 URLFetcherRequestListener request_listener_; |
| 246 net::FakeURLFetcherFactory factory_; | 244 net::FakeURLFetcherFactory factory_; |
| 247 }; | 245 }; |
| 248 | 246 |
| 249 ConfigParserTest::ConfigParserTest() | 247 ConfigParserTest::ConfigParserTest() |
| 250 : ui_thread_(content::BrowserThread::UI, &loop_), | 248 : test_browser_thread_bundle_( |
| 251 io_thread_(content::BrowserThread::IO, &loop_), | 249 content::TestBrowserThreadBundle::IO_MAINLOOP), |
| 252 factory_(NULL, base::Bind(&ConfigParserTest::CreateFakeURLFetcher, | 250 factory_(NULL, |
| 253 base::Unretained(this))) { | 251 base::Bind(&ConfigParserTest::CreateFakeURLFetcher, |
| 254 } | 252 base::Unretained(this))) {} |
| 255 | 253 |
| 256 ConfigParserTest::~ConfigParserTest() {} | 254 ConfigParserTest::~ConfigParserTest() {} |
| 257 | 255 |
| 258 std::unique_ptr<BrandcodeConfigFetcher> ConfigParserTest::WaitForRequest( | 256 std::unique_ptr<BrandcodeConfigFetcher> ConfigParserTest::WaitForRequest( |
| 259 const GURL& url) { | 257 const GURL& url) { |
| 260 EXPECT_CALL(*this, Callback()); | 258 EXPECT_CALL(*this, Callback()); |
| 261 std::unique_ptr<BrandcodeConfigFetcher> fetcher(new BrandcodeConfigFetcher( | 259 std::unique_ptr<BrandcodeConfigFetcher> fetcher(new BrandcodeConfigFetcher( |
| 262 base::Bind(&ConfigParserTest::Callback, base::Unretained(this)), url, | 260 base::Bind(&ConfigParserTest::Callback, base::Unretained(this)), url, |
| 263 "ABCD")); | 261 "ABCD")); |
| 264 base::RunLoop().RunUntilIdle(); | 262 base::RunLoop().RunUntilIdle(); |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 new ResettableSettingsSnapshot(profile())); | 1052 new ResettableSettingsSnapshot(profile())); |
| 1055 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, | 1053 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, |
| 1056 base::Unretained(&capture))); | 1054 base::Unretained(&capture))); |
| 1057 deleted_snapshot.reset(); | 1055 deleted_snapshot.reset(); |
| 1058 // Running remaining tasks shouldn't trigger the callback to be called as | 1056 // Running remaining tasks shouldn't trigger the callback to be called as |
| 1059 // |deleted_snapshot| was deleted before it could run. | 1057 // |deleted_snapshot| was deleted before it could run. |
| 1060 base::RunLoop().RunUntilIdle(); | 1058 base::RunLoop().RunUntilIdle(); |
| 1061 } | 1059 } |
| 1062 | 1060 |
| 1063 } // namespace | 1061 } // namespace |
| OLD | NEW |