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

Side by Side Diff: Source/core/loader/cache/CachedImageTest.cpp

Issue 19906002: Move data/ directory from WebKit/chromium/tests into web/tests/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 TEST(CachedImageTest, CancelOnDetach) 142 TEST(CachedImageTest, CancelOnDetach)
143 { 143 {
144 KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html"); 144 KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html");
145 145
146 WebKit::WebURLResponse response; 146 WebKit::WebURLResponse response;
147 response.initialize(); 147 response.initialize();
148 response.setMIMEType("text/html"); 148 response.setMIMEType("text/html");
149 WTF::String localPath = WebKit::Platform::current()->unitTestSupport()->webK itRootDir(); 149 WTF::String localPath = WebKit::Platform::current()->unitTestSupport()->webK itRootDir();
150 localPath.append("/Source/WebKit/chromium/tests/data/cancelTest.html"); 150 localPath.append("/Source/web/tests/data/cancelTest.html");
151 WebKit::Platform::current()->unitTestSupport()->registerMockedURL(testURL, r esponse, localPath); 151 WebKit::Platform::current()->unitTestSupport()->registerMockedURL(testURL, r esponse, localPath);
152 152
153 // Create enough of a mocked world to get a functioning ResourceLoader. 153 // Create enough of a mocked world to get a functioning ResourceLoader.
154 Page::PageClients pageClients; 154 Page::PageClients pageClients;
155 fillWithEmptyClients(pageClients); 155 fillWithEmptyClients(pageClients);
156 EmptyFrameLoaderClient frameLoaderClient; 156 EmptyFrameLoaderClient frameLoaderClient;
157 Page page(pageClients); 157 Page page(pageClients);
158 RefPtr<Frame> frame = Frame::create(&page, 0, &frameLoaderClient); 158 RefPtr<Frame> frame = Frame::create(&page, 0, &frameLoaderClient);
159 frame->setView(FrameView::create(frame.get())); 159 frame->setView(FrameView::create(frame.get()));
160 frame->init(); 160 frame->init();
(...skipping 16 matching lines...) Expand all
177 177
178 // Trigger the cancel timer, ensure the load was cancelled and the resource was evicted from the cache. 178 // Trigger the cancel timer, ensure the load was cancelled and the resource was evicted from the cache.
179 runPendingTasks(); 179 runPendingTasks();
180 EXPECT_EQ(CachedResource::LoadError, cachedImage->status()); 180 EXPECT_EQ(CachedResource::LoadError, cachedImage->status());
181 EXPECT_EQ(reinterpret_cast<CachedResource*>(0), memoryCache()->resourceForUR L(testURL)); 181 EXPECT_EQ(reinterpret_cast<CachedResource*>(0), memoryCache()->resourceForUR L(testURL));
182 182
183 WebKit::Platform::current()->unitTestSupport()->unregisterMockedURL(testURL) ; 183 WebKit::Platform::current()->unitTestSupport()->unregisterMockedURL(testURL) ;
184 } 184 }
185 185
186 } // namespace 186 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698