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

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

Issue 2654933003: platform/testing/{URL|Unit}TestHelpers improvements (Closed)
Patch Set: header changes 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 protected: 59 protected:
60 ViewportTest() 60 ViewportTest()
61 : m_baseURL("http://www.test.com/"), m_chromeURL("chrome://") {} 61 : m_baseURL("http://www.test.com/"), m_chromeURL("chrome://") {}
62 62
63 ~ViewportTest() override { 63 ~ViewportTest() override {
64 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 64 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs();
65 WebCache::clear(); 65 WebCache::clear();
66 } 66 }
67 67
68 void registerMockedHttpURLLoad(const std::string& fileName) { 68 void registerMockedHttpURLLoad(const std::string& fileName) {
69 URLTestHelpers::registerMockedURLFromBaseURL( 69 URLTestHelpers::registerMockedURLLoadFromBase(
70 WebString::fromUTF8(m_baseURL.c_str()), 70 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(),
71 WebString::fromUTF8(fileName.c_str())); 71 WebString::fromUTF8(fileName));
72 } 72 }
73 73
74 void registerMockedChromeURLLoad(const std::string& fileName) { 74 void registerMockedChromeURLLoad(const std::string& fileName) {
75 URLTestHelpers::registerMockedURLFromBaseURL( 75 URLTestHelpers::registerMockedURLLoadFromBase(
76 WebString::fromUTF8(m_chromeURL.c_str()), 76 WebString::fromUTF8(m_chromeURL), testing::webTestDataPath(),
77 WebString::fromUTF8(fileName.c_str())); 77 WebString::fromUTF8(fileName));
78 } 78 }
79 79
80 void executeScript(WebFrame* frame, const WebString& code) { 80 void executeScript(WebFrame* frame, const WebString& code) {
81 frame->executeScript(WebScriptSource(code)); 81 frame->executeScript(WebScriptSource(code));
82 runPendingTasks(); 82 runPendingTasks();
83 } 83 }
84 84
85 std::string m_baseURL; 85 std::string m_baseURL;
86 std::string m_chromeURL; 86 std::string m_chromeURL;
87 }; 87 };
(...skipping 3118 matching lines...) Expand 10 before | Expand all | Expand 10 after
3206 m_baseURL + "viewport/viewport-warnings-7.html", true, &webFrameClient, 3206 m_baseURL + "viewport/viewport-warnings-7.html", true, &webFrameClient,
3207 nullptr, nullptr, setViewportSettings); 3207 nullptr, nullptr, setViewportSettings);
3208 3208
3209 Page* page = webViewHelper.webView()->page(); 3209 Page* page = webViewHelper.webView()->page();
3210 runViewportTest(page, 320, 352); 3210 runViewportTest(page, 320, 352);
3211 3211
3212 EXPECT_EQ(0U, webFrameClient.messages.size()); 3212 EXPECT_EQ(0U, webFrameClient.messages.size());
3213 } 3213 }
3214 3214
3215 } // namespace blink 3215 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/TouchActionTest.cpp ('k') | third_party/WebKit/Source/web/tests/VisualViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698