| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |