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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2683033005: URLLoaderMockFactory: clear MemoryCache in unregisterAllURLs (Closed)
Patch Set: fix 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "platform/geometry/IntRect.h" 62 #include "platform/geometry/IntRect.h"
63 #include "platform/geometry/IntSize.h" 63 #include "platform/geometry/IntSize.h"
64 #include "platform/graphics/Color.h" 64 #include "platform/graphics/Color.h"
65 #include "platform/graphics/GraphicsContext.h" 65 #include "platform/graphics/GraphicsContext.h"
66 #include "platform/graphics/paint/SkPictureBuilder.h" 66 #include "platform/graphics/paint/SkPictureBuilder.h"
67 #include "platform/scroll/ScrollTypes.h" 67 #include "platform/scroll/ScrollTypes.h"
68 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" 68 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
69 #include "platform/testing/URLTestHelpers.h" 69 #include "platform/testing/URLTestHelpers.h"
70 #include "platform/testing/UnitTestHelpers.h" 70 #include "platform/testing/UnitTestHelpers.h"
71 #include "public/platform/Platform.h" 71 #include "public/platform/Platform.h"
72 #include "public/platform/WebCache.h"
73 #include "public/platform/WebDisplayMode.h" 72 #include "public/platform/WebDisplayMode.h"
74 #include "public/platform/WebDragData.h" 73 #include "public/platform/WebDragData.h"
75 #include "public/platform/WebDragOperation.h" 74 #include "public/platform/WebDragOperation.h"
76 #include "public/platform/WebFloatPoint.h" 75 #include "public/platform/WebFloatPoint.h"
77 #include "public/platform/WebInputEvent.h" 76 #include "public/platform/WebInputEvent.h"
78 #include "public/platform/WebKeyboardEvent.h" 77 #include "public/platform/WebKeyboardEvent.h"
79 #include "public/platform/WebLayerTreeView.h" 78 #include "public/platform/WebLayerTreeView.h"
80 #include "public/platform/WebMockClipboard.h" 79 #include "public/platform/WebMockClipboard.h"
81 #include "public/platform/WebSize.h" 80 #include "public/platform/WebSize.h"
82 #include "public/platform/WebThread.h" 81 #include "public/platform/WebThread.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 class WebViewTest 221 class WebViewTest
223 : public ::testing::Test, 222 : public ::testing::Test,
224 public ::testing::WithParamInterface<TestParamRootLayerScrolling>, 223 public ::testing::WithParamInterface<TestParamRootLayerScrolling>,
225 private ScopedRootLayerScrollingForTest { 224 private ScopedRootLayerScrollingForTest {
226 public: 225 public:
227 WebViewTest() 226 WebViewTest()
228 : ScopedRootLayerScrollingForTest(GetParam()), 227 : ScopedRootLayerScrollingForTest(GetParam()),
229 m_baseURL("http://www.test.com/") {} 228 m_baseURL("http://www.test.com/") {}
230 229
231 void TearDown() override { 230 void TearDown() override {
232 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 231 Platform::current()
233 WebCache::clear(); 232 ->getURLLoaderMockFactory()
233 ->unregisterAllURLsAndClearMemoryCache();
234 } 234 }
235 235
236 protected: 236 protected:
237 std::string registerMockedHttpURLLoad(const std::string& fileName) { 237 std::string registerMockedHttpURLLoad(const std::string& fileName) {
238 return URLTestHelpers::registerMockedURLLoadFromBase( 238 return URLTestHelpers::registerMockedURLLoadFromBase(
239 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(), 239 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(),
240 WebString::fromUTF8(fileName)) 240 WebString::fromUTF8(fileName))
241 .string() 241 .string()
242 .utf8(); 242 .utf8();
243 } 243 }
(...skipping 4019 matching lines...) Expand 10 before | Expand all | Expand 10 after
4263 EXPECT_EQ(expectedWidth, vwElement->offsetWidth()); 4263 EXPECT_EQ(expectedWidth, vwElement->offsetWidth());
4264 EXPECT_EQ(expectedHeight, vwElement->offsetHeight()); 4264 EXPECT_EQ(expectedHeight, vwElement->offsetHeight());
4265 4265
4266 webView->resize(WebSize(800, 600)); 4266 webView->resize(WebSize(800, 600));
4267 frame->printEnd(); 4267 frame->printEnd();
4268 4268
4269 EXPECT_EQ(800, vwElement->offsetWidth()); 4269 EXPECT_EQ(800, vwElement->offsetWidth());
4270 } 4270 }
4271 4271
4272 } // namespace blink 4272 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698