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

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

Issue 23819019: Refactor fixed layout mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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
« no previous file with comments | « Source/web/tests/WebFrameTest.cpp ('k') | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698