| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 FrameTestHelpers::WebViewHelper webViewHelper; | 99 FrameTestHelpers::WebViewHelper webViewHelper; |
| 100 WebViewImpl* webViewImpl = toWebViewImpl(webViewHelper.initializeAndLoad(bas
eURL + fileName, true)); | 100 WebViewImpl* webViewImpl = toWebViewImpl(webViewHelper.initializeAndLoad(bas
eURL + fileName, true)); |
| 101 webViewImpl->enableFixedLayoutMode(true); | |
| 102 webViewImpl->settings()->setViewportEnabled(true); | 101 webViewImpl->settings()->setViewportEnabled(true); |
| 103 int pageWidth = 640; | 102 int pageWidth = 640; |
| 104 int pageHeight = 480; | 103 int pageHeight = 480; |
| 105 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 104 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
| 106 webViewImpl->layout(); | 105 webViewImpl->layout(); |
| 107 | 106 |
| 108 webViewImpl->setPageScaleFactor(2, WebPoint()); | 107 webViewImpl->setPageScaleFactor(2, WebPoint()); |
| 109 | 108 |
| 110 FrameView* view = webViewImpl->page()->mainFrame()->view(); | 109 FrameView* view = webViewImpl->page()->mainFrame()->view(); |
| 111 RefPtr<Document> document = webViewImpl->page()->mainFrame()->document(); | 110 RefPtr<Document> document = webViewImpl->page()->mainFrame()->document(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x); | 273 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x); |
| 275 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y); | 274 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y); |
| 276 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); | 275 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); |
| 277 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); | 276 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); |
| 278 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); | 277 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); |
| 279 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); | 278 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); |
| 280 } | 279 } |
| 281 } | 280 } |
| 282 | 281 |
| 283 } // anonymous namespace | 282 } // anonymous namespace |
| OLD | NEW |