OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |