| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" | 6 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" |
| 7 #include "testing/gmock/include/gmock/gmock.h" | 7 #include "testing/gmock/include/gmock/gmock.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 using testing::SaveArg; | 10 using testing::SaveArg; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 MOCK_METHOD1(DeviceRemoved, void(const std::string& name)); | 162 MOCK_METHOD1(DeviceRemoved, void(const std::string& name)); |
| 163 | 163 |
| 164 MOCK_METHOD0(DeviceCacheFlushed, void()); | 164 MOCK_METHOD0(DeviceCacheFlushed, void()); |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 class PrivetDeviceListerTest : public testing::Test { | 167 class PrivetDeviceListerTest : public testing::Test { |
| 168 public: | 168 public: |
| 169 PrivetDeviceListerTest() : mock_client_(&mock_delegate_) { | 169 PrivetDeviceListerTest() : mock_client_(&mock_delegate_) { |
| 170 } | 170 } |
| 171 | 171 |
| 172 virtual ~PrivetDeviceListerTest() { | 172 ~PrivetDeviceListerTest() override { |
| 173 } | 173 } |
| 174 | 174 |
| 175 virtual void SetUp() override { | 175 void SetUp() override { |
| 176 example_attrs_.push_back("tXtvers=1"); | 176 example_attrs_.push_back("tXtvers=1"); |
| 177 example_attrs_.push_back("ty=My Printer"); | 177 example_attrs_.push_back("ty=My Printer"); |
| 178 example_attrs_.push_back("nOte=This is my Printer"); | 178 example_attrs_.push_back("nOte=This is my Printer"); |
| 179 example_attrs_.push_back("CS=ONlInE"); | 179 example_attrs_.push_back("CS=ONlInE"); |
| 180 example_attrs_.push_back("id="); | 180 example_attrs_.push_back("id="); |
| 181 | 181 |
| 182 service_description_.service_name = "myprinter._privet._tcp.local"; | 182 service_description_.service_name = "myprinter._privet._tcp.local"; |
| 183 service_description_.address = net::HostPortPair("myprinter.local", 6006); | 183 service_description_.address = net::HostPortPair("myprinter.local", 6006); |
| 184 service_description_.metadata = example_attrs_; | 184 service_description_.metadata = example_attrs_; |
| 185 service_description_.last_seen = base::Time() + | 185 service_description_.last_seen = base::Time() + |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 testing::Mock::VerifyAndClear(&mock_delegate_); | 303 testing::Mock::VerifyAndClear(&mock_delegate_); |
| 304 | 304 |
| 305 EXPECT_CALL(*service_watcher, DiscoverNewServices(false)); | 305 EXPECT_CALL(*service_watcher, DiscoverNewServices(false)); |
| 306 privet_lister.DiscoverNewDevices(false); | 306 privet_lister.DiscoverNewDevices(false); |
| 307 } | 307 } |
| 308 | 308 |
| 309 | 309 |
| 310 } // namespace | 310 } // namespace |
| 311 | 311 |
| 312 } // namespace local_discovery | 312 } // namespace local_discovery |
| OLD | NEW |