| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/thread_task_runner_handle.h" |
| 5 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" | 6 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" |
| 6 | |
| 7 #include "chrome/browser/local_discovery/privet_http_impl.h" | 7 #include "chrome/browser/local_discovery/privet_http_impl.h" |
| 8 #include "chrome/browser/local_discovery/privet_notifications.h" | 8 #include "chrome/browser/local_discovery/privet_notifications.h" |
| 9 #include "net/url_request/test_url_fetcher_factory.h" | 9 #include "net/url_request/test_url_fetcher_factory.h" |
| 10 #include "net/url_request/url_request_test_util.h" | 10 #include "net/url_request/url_request_test_util.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using testing::StrictMock; | 14 using testing::StrictMock; |
| 15 | 15 |
| 16 using ::testing::_; | 16 using ::testing::_; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 return scoped_ptr<PrivetHTTPResolution>( | 73 return scoped_ptr<PrivetHTTPResolution>( |
| 74 new MockResolution(name, request_context_.get())); | 74 new MockResolution(name, request_context_.get())); |
| 75 } | 75 } |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 scoped_refptr<net::URLRequestContextGetter> request_context_; | 78 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 class PrivetNotificationsListenerTest : public ::testing::Test { | 81 class PrivetNotificationsListenerTest : public ::testing::Test { |
| 82 public: | 82 public: |
| 83 PrivetNotificationsListenerTest() : request_context_( | 83 PrivetNotificationsListenerTest() |
| 84 new net::TestURLRequestContextGetter(base::MessageLoopProxy::current())) { | 84 : request_context_(new net::TestURLRequestContextGetter( |
| 85 base::ThreadTaskRunnerHandle::Get())) { |
| 85 notification_listener_.reset(new PrivetNotificationsListener( | 86 notification_listener_.reset(new PrivetNotificationsListener( |
| 86 scoped_ptr<PrivetHTTPAsynchronousFactory>( | 87 scoped_ptr<PrivetHTTPAsynchronousFactory>( |
| 87 new MockPrivetHttpFactory(request_context_.get())), | 88 new MockPrivetHttpFactory(request_context_.get())), |
| 88 &mock_delegate_)); | 89 &mock_delegate_)); |
| 89 | 90 |
| 90 description_.name = kExampleDeviceHumanName; | 91 description_.name = kExampleDeviceHumanName; |
| 91 description_.description = kExampleDeviceDescription; | 92 description_.description = kExampleDeviceDescription; |
| 92 } | 93 } |
| 93 | 94 |
| 94 virtual ~PrivetNotificationsListenerTest() { | 95 virtual ~PrivetNotificationsListenerTest() { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 true, | 208 true, |
| 208 kExampleDeviceName, | 209 kExampleDeviceName, |
| 209 description_); | 210 description_); |
| 210 | 211 |
| 211 SuccessfulResponseToInfo(kInfoResponseNoUptime); | 212 SuccessfulResponseToInfo(kInfoResponseNoUptime); |
| 212 } | 213 } |
| 213 | 214 |
| 214 } // namespace | 215 } // namespace |
| 215 | 216 |
| 216 } // namespace local_discovery | 217 } // namespace local_discovery |
| OLD | NEW |