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

Side by Side Diff: third_party/WebKit/Source/web/tests/TouchActionTest.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) 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 26 matching lines...) Expand all
37 #include "core/frame/FrameView.h" 37 #include "core/frame/FrameView.h"
38 #include "core/frame/LocalFrame.h" 38 #include "core/frame/LocalFrame.h"
39 #include "core/html/HTMLIFrameElement.h" 39 #include "core/html/HTMLIFrameElement.h"
40 #include "core/input/EventHandler.h" 40 #include "core/input/EventHandler.h"
41 #include "core/layout/HitTestResult.h" 41 #include "core/layout/HitTestResult.h"
42 #include "core/layout/LayoutTreeAsText.h" 42 #include "core/layout/LayoutTreeAsText.h"
43 #include "core/layout/api/LayoutViewItem.h" 43 #include "core/layout/api/LayoutViewItem.h"
44 #include "platform/testing/URLTestHelpers.h" 44 #include "platform/testing/URLTestHelpers.h"
45 #include "platform/testing/UnitTestHelpers.h" 45 #include "platform/testing/UnitTestHelpers.h"
46 #include "public/platform/Platform.h" 46 #include "public/platform/Platform.h"
47 #include "public/platform/WebCache.h"
48 #include "public/platform/WebTouchEvent.h" 47 #include "public/platform/WebTouchEvent.h"
49 #include "public/platform/WebURLLoaderMockFactory.h" 48 #include "public/platform/WebURLLoaderMockFactory.h"
50 #include "public/web/WebDocument.h" 49 #include "public/web/WebDocument.h"
51 #include "public/web/WebFrame.h" 50 #include "public/web/WebFrame.h"
52 #include "public/web/WebHitTestResult.h" 51 #include "public/web/WebHitTestResult.h"
53 #include "public/web/WebTouchAction.h" 52 #include "public/web/WebTouchAction.h"
54 #include "public/web/WebView.h" 53 #include "public/web/WebView.h"
55 #include "public/web/WebViewClient.h" 54 #include "public/web/WebViewClient.h"
56 #include "public/web/WebWidgetClient.h" 55 #include "public/web/WebWidgetClient.h"
57 #include "testing/gtest/include/gtest/gtest.h" 56 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 "touch-action-tests.css"); 99 "touch-action-tests.css");
101 URLTestHelpers::registerMockedURLLoadFromBase( 100 URLTestHelpers::registerMockedURLLoadFromBase(
102 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(), 101 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(),
103 "touch-action-tests.js"); 102 "touch-action-tests.js");
104 URLTestHelpers::registerMockedURLLoadFromBase( 103 URLTestHelpers::registerMockedURLLoadFromBase(
105 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(), 104 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(),
106 "white-1x1.png"); 105 "white-1x1.png");
107 } 106 }
108 107
109 void TearDown() override { 108 void TearDown() override {
110 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 109 Platform::current()
111 WebCache::clear(); 110 ->getURLLoaderMockFactory()
111 ->unregisterAllURLsAndClearMemoryCache();
112 } 112 }
113 113
114 protected: 114 protected:
115 void runTouchActionTest(std::string file); 115 void runTouchActionTest(std::string file);
116 void runShadowDOMTest(std::string file); 116 void runShadowDOMTest(std::string file);
117 void runIFrameTest(std::string file); 117 void runIFrameTest(std::string file);
118 void sendTouchEvent(WebView*, WebInputEvent::Type, IntPoint clientPoint); 118 void sendTouchEvent(WebView*, WebInputEvent::Type, IntPoint clientPoint);
119 WebView* setupTest(std::string file, TouchActionTrackingWebWidgetClient&); 119 WebView* setupTest(std::string file, TouchActionTrackingWebWidgetClient&);
120 void runTestOnTree(ContainerNode* root, 120 void runTestOnTree(ContainerNode* root,
121 WebView*, 121 WebView*,
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 412
413 TEST_F(TouchActionTest, ShadowDOM) { 413 TEST_F(TouchActionTest, ShadowDOM) {
414 runShadowDOMTest("touch-action-shadow-dom.html"); 414 runShadowDOMTest("touch-action-shadow-dom.html");
415 } 415 }
416 416
417 TEST_F(TouchActionTest, Pan) { 417 TEST_F(TouchActionTest, Pan) {
418 runTouchActionTest("touch-action-pan.html"); 418 runTouchActionTest("touch-action-pan.html");
419 } 419 }
420 420
421 } // namespace blink 421 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp ('k') | third_party/WebKit/Source/web/tests/ViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698