| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/test/host_list_fetcher.h" | 5 #include "remoting/test/host_list_fetcher.h" | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/macros.h" | 8 #include "base/macros.h" | 
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" | 
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" | 
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 187   void SetUp() override; | 187   void SetUp() override; | 
| 188 | 188 | 
| 189   // Sets the HTTP status and data returned for a specified URL. | 189   // Sets the HTTP status and data returned for a specified URL. | 
| 190   void SetFakeResponse(const GURL& url, | 190   void SetFakeResponse(const GURL& url, | 
| 191                        const std::string& data, | 191                        const std::string& data, | 
| 192                        net::HttpStatusCode code, | 192                        net::HttpStatusCode code, | 
| 193                        net::URLRequestStatus::Status status); | 193                        net::URLRequestStatus::Status status); | 
| 194 | 194 | 
| 195  private: | 195  private: | 
| 196   net::FakeURLFetcherFactory url_fetcher_factory_; | 196   net::FakeURLFetcherFactory url_fetcher_factory_; | 
| 197   scoped_ptr<base::MessageLoopForIO> message_loop_; | 197   std::unique_ptr<base::MessageLoopForIO> message_loop_; | 
| 198 | 198 | 
| 199   DISALLOW_COPY_AND_ASSIGN(HostListFetcherTest); | 199   DISALLOW_COPY_AND_ASSIGN(HostListFetcherTest); | 
| 200 }; | 200 }; | 
| 201 | 201 | 
| 202 void HostListFetcherTest::SetUp() { | 202 void HostListFetcherTest::SetUp() { | 
| 203   DCHECK(!message_loop_); | 203   DCHECK(!message_loop_); | 
| 204   message_loop_.reset(new base::MessageLoopForIO); | 204   message_loop_.reset(new base::MessageLoopForIO); | 
| 205 | 205 | 
| 206   SetFakeResponse(GURL(kHostListProdRequestUrl), | 206   SetFakeResponse(GURL(kHostListProdRequestUrl), | 
| 207                   kHostListEmptyResponse, net::HTTP_NOT_FOUND, | 207                   kHostListEmptyResponse, net::HTTP_NOT_FOUND, | 
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 436                                      empty_host_list_callback); | 436                                      empty_host_list_callback); | 
| 437 | 437 | 
| 438   empty_items_run_loop.Run(); | 438   empty_items_run_loop.Run(); | 
| 439 | 439 | 
| 440   // If we received an empty items response, then host list should be empty. | 440   // If we received an empty items response, then host list should be empty. | 
| 441   EXPECT_TRUE(empty_items_hostlist.empty()); | 441   EXPECT_TRUE(empty_items_hostlist.empty()); | 
| 442 } | 442 } | 
| 443 | 443 | 
| 444 }  // namespace test | 444 }  // namespace test | 
| 445 }  // namespace remoting | 445 }  // namespace remoting | 
| OLD | NEW | 
|---|