OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 EXPECT_EQ(WebInputEvent::Undefined, mouse.type); | 90 EXPECT_EQ(WebInputEvent::Undefined, mouse.type); |
91 } | 91 } |
92 | 92 |
93 TEST(WebInputEventConversionTest, InputEventsScaling) | 93 TEST(WebInputEventConversionTest, InputEventsScaling) |
94 { | 94 { |
95 const std::string baseURL("http://www.test.com/"); | 95 const std::string baseURL("http://www.test.com/"); |
96 const std::string fileName("fixed_layout.html"); | 96 const std::string fileName("fixed_layout.html"); |
97 | 97 |
98 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s
tr()), WebString::fromUTF8("fixed_layout.html")); | 98 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s
tr()), WebString::fromUTF8("fixed_layout.html")); |
99 WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::creat
eWebViewAndLoad(baseURL + fileName, true)); | 99 WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::creat
eWebViewAndLoad(baseURL + fileName, true)); |
100 webViewImpl->enableFixedLayoutMode(true); | |
101 webViewImpl->settings()->setViewportEnabled(true); | 100 webViewImpl->settings()->setViewportEnabled(true); |
102 int pageWidth = 640; | 101 int pageWidth = 640; |
103 int pageHeight = 480; | 102 int pageHeight = 480; |
104 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 103 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
105 webViewImpl->layout(); | 104 webViewImpl->layout(); |
106 | 105 |
107 webViewImpl->setPageScaleFactor(2, WebPoint()); | 106 webViewImpl->setPageScaleFactor(2, WebPoint()); |
108 | 107 |
109 FrameView* view = webViewImpl->page()->mainFrame()->view(); | 108 FrameView* view = webViewImpl->page()->mainFrame()->view(); |
110 RefPtr<Document> document = webViewImpl->page()->mainFrame()->document(); | 109 RefPtr<Document> document = webViewImpl->page()->mainFrame()->document(); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); | 274 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); |
276 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); | 275 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); |
277 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); | 276 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); |
278 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); | 277 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); |
279 } | 278 } |
280 | 279 |
281 webViewImpl->close(); | 280 webViewImpl->close(); |
282 } | 281 } |
283 | 282 |
284 } // anonymous namespace | 283 } // anonymous namespace |
OLD | NEW |