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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameSerializerTest.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 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return matches; 100 return matches;
101 } 101 }
102 102
103 } // namespace 103 } // namespace
104 104
105 class WebFrameSerializerTest : public ::testing::Test { 105 class WebFrameSerializerTest : public ::testing::Test {
106 protected: 106 protected:
107 WebFrameSerializerTest() { m_helper.initialize(); } 107 WebFrameSerializerTest() { m_helper.initialize(); }
108 108
109 ~WebFrameSerializerTest() override { 109 ~WebFrameSerializerTest() override {
110 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 110 Platform::current()
111 WebCache::clear(); 111 ->getURLLoaderMockFactory()
112 ->unregisterAllURLsAndClearMemoryCache();
112 } 113 }
113 114
114 void registerMockedImageURLLoad(const String& url) { 115 void registerMockedImageURLLoad(const String& url) {
115 // Image resources need to be mocked, but irrelevant here what image they 116 // Image resources need to be mocked, but irrelevant here what image they
116 // map to. 117 // map to.
117 registerMockedFileURLLoad(URLTestHelpers::toKURL(url.utf8().data()), 118 registerMockedFileURLLoad(URLTestHelpers::toKURL(url.utf8().data()),
118 "frameserialization/awesome.png"); 119 "frameserialization/awesome.png");
119 } 120 }
120 void registerMockedFileURLLoad(const KURL& url, 121 void registerMockedFileURLLoad(const KURL& url,
121 const String& filePath, 122 const String& filePath,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 359
359 TEST_F(WebFrameSerializerSanitizationTest, KeepPopupOverlayIfNotRequested) { 360 TEST_F(WebFrameSerializerSanitizationTest, KeepPopupOverlayIfNotRequested) {
360 webView()->resize(WebSize(500, 500)); 361 webView()->resize(WebSize(500, 500));
361 setRemovePopupOverlay(false); 362 setRemovePopupOverlay(false);
362 String mhtml = generateMHTMLParts("http://www.test.com", "popup.html"); 363 String mhtml = generateMHTMLParts("http://www.test.com", "popup.html");
363 EXPECT_NE(WTF::kNotFound, mhtml.find("class=3D\"overlay")); 364 EXPECT_NE(WTF::kNotFound, mhtml.find("class=3D\"overlay"));
364 EXPECT_NE(WTF::kNotFound, mhtml.find("class=3D\"modal")); 365 EXPECT_NE(WTF::kNotFound, mhtml.find("class=3D\"modal"));
365 } 366 }
366 367
367 } // namespace blink 368 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698