| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/image_fetcher.h" | 5 #import "ios/chrome/browser/net/image_fetcher.h" |
| 6 | 6 |
| 7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 | 8 |
| 9 #include "base/ios/ios_util.h" | 9 #include "base/ios/ios_util.h" |
| 10 #include "base/mac/scoped_block.h" | 10 #include "base/mac/scoped_block.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
| 17 #include "net/url_request/test_url_fetcher_factory.h" | 17 #include "net/url_request/test_url_fetcher_factory.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 #include "testing/platform_test.h" | 20 #include "testing/platform_test.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 static unsigned char kJPGImage[] = { | 24 static unsigned char kJPGImage[] = { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 EXPECT_EQ(static_cast<UIImage*>(nil), result_); | 184 EXPECT_EQ(static_cast<UIImage*>(nil), result_); |
| 185 EXPECT_FALSE(called_); | 185 EXPECT_FALSE(called_); |
| 186 } | 186 } |
| 187 | 187 |
| 188 TEST_F(ImageFetcherTest, TestCallbacksNotCalledDuringDeletion) { | 188 TEST_F(ImageFetcherTest, TestCallbacksNotCalledDuringDeletion) { |
| 189 image_fetcher_->StartDownload(GURL(kTestUrl), callback_); | 189 image_fetcher_->StartDownload(GURL(kTestUrl), callback_); |
| 190 image_fetcher_.reset(); | 190 image_fetcher_.reset(); |
| 191 EXPECT_FALSE(called_); | 191 EXPECT_FALSE(called_); |
| 192 } | 192 } |
| 193 | 193 |
| OLD | NEW |