OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/net/web_http_protocol_handler_delegate.h" | 5 #include "ios/web/net/web_http_protocol_handler_delegate.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
16 #include "ios/web/public/test/scoped_testing_web_client.h" | 16 #include "ios/web/public/test/scoped_testing_web_client.h" |
17 #include "ios/web/public/web_client.h" | 17 #include "ios/web/public/web_client.h" |
18 #include "net/url_request/url_request_test_util.h" | 18 #include "net/url_request/url_request_test_util.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #import "third_party/ocmock/OCMock/OCMock.h" | 20 #import "third_party/ocmock/OCMock/OCMock.h" |
21 | 21 |
22 namespace web { | 22 namespace web { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // Empty dictionary so User-Agent check fails. | 152 // Empty dictionary so User-Agent check fails. |
153 NSDictionary* headers = @{}; | 153 NSDictionary* headers = @{}; |
154 NSURL* url = [NSURL URLWithString:@"file:///steal/this/file.html"]; | 154 NSURL* url = [NSURL URLWithString:@"file:///steal/this/file.html"]; |
155 id mock_request = [OCMockObject mockForClass:[NSURLRequest class]]; | 155 id mock_request = [OCMockObject mockForClass:[NSURLRequest class]]; |
156 [[[mock_request stub] andReturn:headers] allHTTPHeaderFields]; | 156 [[[mock_request stub] andReturn:headers] allHTTPHeaderFields]; |
157 [[[mock_request stub] andReturn:url] URL]; | 157 [[[mock_request stub] andReturn:url] URL]; |
158 EXPECT_FALSE(IsStaticFileRequest(mock_request)); | 158 EXPECT_FALSE(IsStaticFileRequest(mock_request)); |
159 } | 159 } |
160 | 160 |
161 } // namespace web | 161 } // namespace web |
OLD | NEW |