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

Side by Side Diff: chrome/browser/local_discovery/gcd_api_flow_unittest.cc

Issue 1127553002: [chrome/browser/local_discovery] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Build break : Dependency in components/wifi classes Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_http_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/local_discovery/gcd_api_flow.h" 5 #include "chrome/browser/local_discovery/gcd_api_flow.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/thread_task_runner_handle.h"
9 #include "base/values.h" 10 #include "base/values.h"
10 #include "chrome/browser/local_discovery/gcd_api_flow_impl.h" 11 #include "chrome/browser/local_discovery/gcd_api_flow_impl.h"
11 #include "content/public/test/test_browser_thread.h" 12 #include "content/public/test/test_browser_thread.h"
12 #include "google_apis/gaia/fake_oauth2_token_service.h" 13 #include "google_apis/gaia/fake_oauth2_token_service.h"
13 #include "google_apis/gaia/google_service_auth_error.h" 14 #include "google_apis/gaia/google_service_auth_error.h"
14 #include "net/base/host_port_pair.h" 15 #include "net/base/host_port_pair.h"
15 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
16 #include "net/http/http_request_headers.h" 17 #include "net/http/http_request_headers.h"
17 #include "net/url_request/test_url_fetcher_factory.h" 18 #include "net/url_request/test_url_fetcher_factory.h"
18 #include "net/url_request/url_request_test_util.h" 19 #include "net/url_request/url_request_test_util.h"
(...skipping 19 matching lines...) Expand all
38 MOCK_METHOD1(OnGCDAPIFlowComplete, void(const base::DictionaryValue&)); 39 MOCK_METHOD1(OnGCDAPIFlowComplete, void(const base::DictionaryValue&));
39 40
40 MOCK_METHOD0(GetURL, GURL()); 41 MOCK_METHOD0(GetURL, GURL());
41 }; 42 };
42 43
43 class GCDApiFlowTest : public testing::Test { 44 class GCDApiFlowTest : public testing::Test {
44 public: 45 public:
45 GCDApiFlowTest() 46 GCDApiFlowTest()
46 : ui_thread_(content::BrowserThread::UI, &loop_), 47 : ui_thread_(content::BrowserThread::UI, &loop_),
47 request_context_(new net::TestURLRequestContextGetter( 48 request_context_(new net::TestURLRequestContextGetter(
48 base::MessageLoopProxy::current())), 49 base::ThreadTaskRunnerHandle::Get())),
49 account_id_(kAccountId) {} 50 account_id_(kAccountId) {}
50 51
51 ~GCDApiFlowTest() override {} 52 ~GCDApiFlowTest() override {}
52 53
53 protected: 54 protected:
54 void SetUp() override { 55 void SetUp() override {
55 token_service_.set_request_context(request_context_.get()); 56 token_service_.set_request_context(request_context_.get());
56 token_service_.AddAccount(account_id_); 57 token_service_.AddAccount(account_id_);
57 ui_thread_.Stop(); // HACK: Fake being on the UI thread 58 ui_thread_.Stop(); // HACK: Fake being on the UI thread
58 59
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 122
122 EXPECT_CALL(*mock_delegate_, 123 EXPECT_CALL(*mock_delegate_,
123 OnGCDAPIFlowError(GCDApiFlow::ERROR_MALFORMED_RESPONSE)); 124 OnGCDAPIFlowError(GCDApiFlow::ERROR_MALFORMED_RESPONSE));
124 125
125 fetcher->delegate()->OnURLFetchComplete(fetcher); 126 fetcher->delegate()->OnURLFetchComplete(fetcher);
126 } 127 }
127 128
128 } // namespace 129 } // namespace
129 130
130 } // namespace local_discovery 131 } // namespace local_discovery
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_http_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698