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/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 &mock_delegate_)); | 96 &mock_delegate_)); |
97 | 97 |
98 description_.name = kExampleDeviceHumanName; | 98 description_.name = kExampleDeviceHumanName; |
99 description_.description = kExampleDeviceDescription; | 99 description_.description = kExampleDeviceDescription; |
100 } | 100 } |
101 | 101 |
102 virtual ~PrivetNotificationsListenerTest() {} | 102 virtual ~PrivetNotificationsListenerTest() {} |
103 | 103 |
104 bool SuccessfulResponseToInfo(const std::string& response) { | 104 bool SuccessfulResponseToInfo(const std::string& response) { |
105 net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0); | 105 net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0); |
106 if (!fetcher || GURL(kDeviceInfoURL) != fetcher->GetOriginalURL()) | 106 if (!fetcher || fetcher->GetOriginalURL() != kDeviceInfoURL) |
107 return false; | 107 return false; |
108 | 108 |
109 fetcher->SetResponseString(response); | 109 fetcher->SetResponseString(response); |
110 fetcher->set_status( | 110 fetcher->set_status( |
111 net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK)); | 111 net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK)); |
112 fetcher->set_response_code(200); | 112 fetcher->set_response_code(200); |
113 fetcher->delegate()->OnURLFetchComplete(fetcher); | 113 fetcher->delegate()->OnURLFetchComplete(fetcher); |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 310 |
311 EXPECT_EQ("", service.open_tab_url().spec()); | 311 EXPECT_EQ("", service.open_tab_url().spec()); |
312 EXPECT_EQ(0U, service.open_tab_count()); | 312 EXPECT_EQ(0U, service.open_tab_count()); |
313 EXPECT_EQ(1U, service.disable_notifications_count()); | 313 EXPECT_EQ(1U, service.disable_notifications_count()); |
314 EXPECT_EQ(0U, ui_manager()->GetNotificationCount()); | 314 EXPECT_EQ(0U, ui_manager()->GetNotificationCount()); |
315 } | 315 } |
316 | 316 |
317 } // namespace | 317 } // namespace |
318 | 318 |
319 } // namespace cloud_print | 319 } // namespace cloud_print |
OLD | NEW |