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

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

Issue 1174283002: Fix unit test style in Source/web/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove static Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | Source/web/tests/WebDocumentTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "platform/testing/UnitTestHelpers.h" 44 #include "platform/testing/UnitTestHelpers.h"
45 #include "public/platform/Platform.h" 45 #include "public/platform/Platform.h"
46 #include "public/platform/WebUnitTestSupport.h" 46 #include "public/platform/WebUnitTestSupport.h"
47 #include "public/web/WebConsoleMessage.h" 47 #include "public/web/WebConsoleMessage.h"
48 #include "public/web/WebFrame.h" 48 #include "public/web/WebFrame.h"
49 #include "public/web/WebScriptSource.h" 49 #include "public/web/WebScriptSource.h"
50 #include "public/web/WebSettings.h" 50 #include "public/web/WebSettings.h"
51 #include "public/web/WebViewClient.h" 51 #include "public/web/WebViewClient.h"
52 #include "web/tests/FrameTestHelpers.h" 52 #include "web/tests/FrameTestHelpers.h"
53 #include <gtest/gtest.h> 53 #include <gtest/gtest.h>
54
55 #include <vector> 54 #include <vector>
56 55
57 namespace { 56 namespace blink {
58 57
59 using blink::FrameTestHelpers::UseMockScrollbarSettings; 58 using blink::FrameTestHelpers::UseMockScrollbarSettings;
60 using blink::testing::runPendingTasks; 59 using blink::testing::runPendingTasks;
61 using namespace blink;
62 60
63 class ViewportTest : public ::testing::Test { 61 class ViewportTest : public ::testing::Test {
64 protected: 62 protected:
65 ViewportTest() 63 ViewportTest()
66 : m_baseURL("http://www.test.com/") 64 : m_baseURL("http://www.test.com/")
67 , m_chromeURL("chrome://") 65 , m_chromeURL("chrome://")
68 { 66 {
69 } 67 }
70 68
71 virtual ~ViewportTest() 69 ~ViewportTest() override
72 { 70 {
73 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); 71 Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
74 } 72 }
75 73
76 void registerMockedHttpURLLoad(const std::string& fileName) 74 void registerMockedHttpURLLoad(const std::string& fileName)
77 { 75 {
78 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str())); 76 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str()));
79 } 77 }
80 78
81 void registerMockedChromeURLLoad(const std::string& fileName) 79 void registerMockedChromeURLLoad(const std::string& fileName)
(...skipping 3067 matching lines...) Expand 10 before | Expand all | Expand 10 after
3149 3147
3150 FrameTestHelpers::WebViewHelper webViewHelper; 3148 FrameTestHelpers::WebViewHelper webViewHelper;
3151 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht ml", true, &webFrameClient, 0, setViewportSettings); 3149 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-7.ht ml", true, &webFrameClient, 0, setViewportSettings);
3152 3150
3153 Page* page = webViewHelper.webViewImpl()->page(); 3151 Page* page = webViewHelper.webViewImpl()->page();
3154 runViewportTest(page, 320, 352); 3152 runViewportTest(page, 320, 352);
3155 3153
3156 EXPECT_EQ(0U, webFrameClient.messages.size()); 3154 EXPECT_EQ(0U, webFrameClient.messages.size());
3157 } 3155 }
3158 3156
3159 } // namespace 3157 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | Source/web/tests/WebDocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698