| 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 "chrome/browser/printing/cloud_print/privet_notifications.h" | 5 #include "chrome/browser/printing/cloud_print/privet_notifications.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 private: | 67 private: |
| 68 std::string name_; | 68 std::string name_; |
| 69 scoped_refptr<net::URLRequestContextGetter> request_context_; | 69 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 explicit MockPrivetHttpFactory(net::URLRequestContextGetter* request_context) | 72 explicit MockPrivetHttpFactory(net::URLRequestContextGetter* request_context) |
| 73 : request_context_(request_context) {} | 73 : request_context_(request_context) {} |
| 74 | 74 |
| 75 std::unique_ptr<PrivetHTTPResolution> CreatePrivetHTTP( | 75 std::unique_ptr<PrivetHTTPResolution> CreatePrivetHTTP( |
| 76 const std::string& name) override { | 76 const std::string& name) override { |
| 77 return base::WrapUnique(new MockResolution(name, request_context_.get())); | 77 return base::MakeUnique<MockResolution>(name, request_context_.get()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 scoped_refptr<net::URLRequestContextGetter> request_context_; | 81 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 class PrivetNotificationsListenerTest : public ::testing::Test { | 84 class PrivetNotificationsListenerTest : public ::testing::Test { |
| 85 public: | 85 public: |
| 86 PrivetNotificationsListenerTest() | 86 PrivetNotificationsListenerTest() |
| 87 : request_context_(new net::TestURLRequestContextGetter( | 87 : request_context_(new net::TestURLRequestContextGetter( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 TEST_F(PrivetNotificationsListenerTest, DictionaryErrorTest) { | 178 TEST_F(PrivetNotificationsListenerTest, DictionaryErrorTest) { |
| 179 notification_listener_->DeviceChanged(kExampleDeviceName, description_); | 179 notification_listener_->DeviceChanged(kExampleDeviceName, description_); |
| 180 SuccessfulResponseToInfo(kInfoResponseNoUptime); | 180 SuccessfulResponseToInfo(kInfoResponseNoUptime); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace | 183 } // namespace |
| 184 | 184 |
| 185 } // namespace cloud_print | 185 } // namespace cloud_print |
| OLD | NEW |