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/location.h" | 5 #include "base/location.h" |
6 #include "base/single_thread_task_runner.h" | 6 #include "base/single_thread_task_runner.h" |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "chrome/browser/local_discovery/privet_url_fetcher.h" | 8 #include "chrome/browser/printing/cloud_print/privet_url_fetcher.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 namespace local_discovery { | 16 namespace cloud_print { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 const char kSamplePrivetURL[] = | 20 const char kSamplePrivetURL[] = |
21 "http://10.0.0.8:7676/privet/register?action=start"; | 21 "http://10.0.0.8:7676/privet/register?action=start"; |
22 const char kSamplePrivetToken[] = "MyToken"; | 22 const char kSamplePrivetToken[] = "MyToken"; |
23 const char kEmptyPrivetToken[] = "\"\""; | 23 const char kEmptyPrivetToken[] = "\"\""; |
24 | 24 |
25 const char kSampleParsableJSON[] = "{ \"hello\" : 2 }"; | 25 const char kSampleParsableJSON[] = "{ \"hello\" : 2 }"; |
26 const char kSampleUnparsableJSON[] = "{ \"hello\" : }"; | 26 const char kSampleUnparsableJSON[] = "{ \"hello\" : }"; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS, | 292 fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS, |
293 net::OK)); | 293 net::OK)); |
294 fetcher->set_response_code(200); | 294 fetcher->set_response_code(200); |
295 | 295 |
296 EXPECT_CALL(delegate_, OnFileInternal()); | 296 EXPECT_CALL(delegate_, OnFileInternal()); |
297 fetcher->delegate()->OnURLFetchComplete(fetcher); | 297 fetcher->delegate()->OnURLFetchComplete(fetcher); |
298 } | 298 } |
299 | 299 |
300 } // namespace | 300 } // namespace |
301 | 301 |
302 } // namespace local_discovery | 302 } // namespace cloud_print |
OLD | NEW |