| 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/local_discovery/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" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 if (response_is_file) { | 64 if (response_is_file) { |
| 65 EXPECT_TRUE(response_file != base::FilePath()); | 65 EXPECT_TRUE(response_file != base::FilePath()); |
| 66 OnFileInternal(); | 66 OnFileInternal(); |
| 67 } else { | 67 } else { |
| 68 OnRawDataInternal(data); | 68 OnRawDataInternal(data); |
| 69 } | 69 } |
| 70 | 70 |
| 71 return true; | 71 return true; |
| 72 } | 72 } |
| 73 | 73 |
| 74 MOCK_METHOD1(OnRawDataInternal, void(std::string data)); | 74 MOCK_METHOD1(OnRawDataInternal, void(const std::string& data)); |
| 75 | 75 |
| 76 MOCK_METHOD0(OnFileInternal, void()); | 76 MOCK_METHOD0(OnFileInternal, void()); |
| 77 | 77 |
| 78 const base::DictionaryValue* saved_value() { return saved_value_.get(); } | 78 const base::DictionaryValue* saved_value() { return saved_value_.get(); } |
| 79 | 79 |
| 80 void SetRawMode(bool raw_mode) { | 80 void SetRawMode(bool raw_mode) { |
| 81 raw_mode_ = raw_mode; | 81 raw_mode_ = raw_mode; |
| 82 } | 82 } |
| 83 | 83 |
| 84 std::string GetAuthToken() { return "MyAuthToken"; } | 84 std::string GetAuthToken() { return "MyAuthToken"; } |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 std::string header_token; | 315 std::string header_token; |
| 316 ASSERT_FALSE(headers.GetHeader("X-Privet-Token", &header_token)); | 316 ASSERT_FALSE(headers.GetHeader("X-Privet-Token", &header_token)); |
| 317 ASSERT_FALSE(headers.GetHeader("X-Privet-Auth", &header_token)); | 317 ASSERT_FALSE(headers.GetHeader("X-Privet-Auth", &header_token)); |
| 318 ASSERT_TRUE(headers.GetHeader("Authorization", &header_token)); | 318 ASSERT_TRUE(headers.GetHeader("Authorization", &header_token)); |
| 319 ASSERT_EQ("MyAuthToken", header_token); | 319 ASSERT_EQ("MyAuthToken", header_token); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace | 322 } // namespace |
| 323 | 323 |
| 324 } // namespace local_discovery | 324 } // namespace local_discovery |
| OLD | NEW |