Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: ios/web/public/image_fetcher/image_data_fetcher_unittest.mm

Issue 2665673002: Re-enable WebP tests (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ios/web/public/image_fetcher/webp_decoder_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/web/public/image_fetcher/image_data_fetcher.h" 5 #import "ios/web/public/image_fetcher/image_data_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"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 TEST_F(ImageDataFetcherTest, TestPng) { 151 TEST_F(ImageDataFetcherTest, TestPng) {
152 net::TestURLFetcher* fetcher = SetupFetcher(); 152 net::TestURLFetcher* fetcher = SetupFetcher();
153 fetcher->set_response_code(200); 153 fetcher->set_response_code(200);
154 fetcher->SetResponseString(std::string((char*)kPNGImage, sizeof(kPNGImage))); 154 fetcher->SetResponseString(std::string((char*)kPNGImage, sizeof(kPNGImage)));
155 fetcher->delegate()->OnURLFetchComplete(fetcher); 155 fetcher->delegate()->OnURLFetchComplete(fetcher);
156 EXPECT_NE(nil, result_); 156 EXPECT_NE(nil, result_);
157 EXPECT_TRUE(called_); 157 EXPECT_TRUE(called_);
158 } 158 }
159 159
160 TEST_F(ImageDataFetcherTest, TestGoodWebP) { 160 TEST_F(ImageDataFetcherTest, TestGoodWebP) {
161 // TODO(droger): This test fails on iOS 9 x64 devices. http://crbug.com/523235
162 #if defined(OS_IOS) && defined(ARCH_CPU_ARM64) && !TARGET_IPHONE_SIMULATOR
163 if (base::ios::IsRunningOnIOS9OrLater())
164 return;
165 #endif
166 net::TestURLFetcher* fetcher = SetupFetcher(); 161 net::TestURLFetcher* fetcher = SetupFetcher();
167 fetcher->set_response_code(200); 162 fetcher->set_response_code(200);
168 fetcher->SetResponseString( 163 fetcher->SetResponseString(
169 std::string((char*)kWEBPImage, sizeof(kWEBPImage))); 164 std::string((char*)kWEBPImage, sizeof(kWEBPImage)));
170 scoped_refptr<net::HttpResponseHeaders> headers(new net::HttpResponseHeaders( 165 scoped_refptr<net::HttpResponseHeaders> headers(new net::HttpResponseHeaders(
171 std::string(kWEBPHeaderResponse, arraysize(kWEBPHeaderResponse)))); 166 std::string(kWEBPHeaderResponse, arraysize(kWEBPHeaderResponse))));
172 fetcher->set_response_headers(headers); 167 fetcher->set_response_headers(headers);
173 fetcher->delegate()->OnURLFetchComplete(fetcher); 168 fetcher->delegate()->OnURLFetchComplete(fetcher);
174 worker_thread_.FlushForTesting(); 169 worker_thread_.FlushForTesting();
175 base::RunLoop().RunUntilIdle(); 170 base::RunLoop().RunUntilIdle();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 EXPECT_FALSE(called_); 203 EXPECT_FALSE(called_);
209 } 204 }
210 205
211 TEST_F(ImageDataFetcherTest, TestCallbacksNotCalledDuringDeletion) { 206 TEST_F(ImageDataFetcherTest, TestCallbacksNotCalledDuringDeletion) {
212 image_fetcher_->StartDownload(GURL(kTestUrl), callback_); 207 image_fetcher_->StartDownload(GURL(kTestUrl), callback_);
213 image_fetcher_.reset(); 208 image_fetcher_.reset();
214 EXPECT_FALSE(called_); 209 EXPECT_FALSE(called_);
215 } 210 }
216 211
217 } // namespace web 212 } // namespace web
OLDNEW
« no previous file with comments | « no previous file | ios/web/public/image_fetcher/webp_decoder_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698