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 #import "ios/chrome/browser/net/retryable_url_fetcher.h" | 5 #import "ios/chrome/browser/net/retryable_url_fetcher.h" |
6 | 6 |
7 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
| 8 #include "base/message_loop/message_loop.h" |
8 #include "ios/web/public/test/test_web_thread.h" | 9 #include "ios/web/public/test/test_web_thread.h" |
9 #include "net/url_request/test_url_fetcher_factory.h" | 10 #include "net/url_request/test_url_fetcher_factory.h" |
10 #include "net/url_request/url_fetcher_delegate.h" | 11 #include "net/url_request/url_fetcher_delegate.h" |
11 #include "net/url_request/url_request_test_util.h" | 12 #include "net/url_request/url_request_test_util.h" |
12 #import "testing/gtest_mac.h" | 13 #import "testing/gtest_mac.h" |
13 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 // An arbitrary text string for a fake response. | 17 // An arbitrary text string for a fake response. |
17 NSString* const kFakeResponseString = @"Something interesting here."; | 18 NSString* const kFakeResponseString = @"Something interesting here."; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 DCHECK(fetcher); | 95 DCHECK(fetcher); |
95 DCHECK(fetcher->delegate()); | 96 DCHECK(fetcher->delegate()); |
96 [test_delegate_ setResponsesProcessed:0U]; | 97 [test_delegate_ setResponsesProcessed:0U]; |
97 fetcher->set_response_code(404); | 98 fetcher->set_response_code(404); |
98 fetcher->SetResponseString(""); | 99 fetcher->SetResponseString(""); |
99 fetcher->delegate()->OnURLFetchComplete(fetcher); | 100 fetcher->delegate()->OnURLFetchComplete(fetcher); |
100 EXPECT_EQ(0U, [test_delegate_ responsesProcessed]); | 101 EXPECT_EQ(0U, [test_delegate_ responsesProcessed]); |
101 } | 102 } |
102 | 103 |
103 } // namespace | 104 } // namespace |
OLD | NEW |