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

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

Issue 23506013: Make the embedder responsible for creating the WebFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix lifetime on frame detach 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') | Source/web/tests/WebPageNewSerializerTest.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) 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 WebMouseEventBuilder mouse(0, 0, *event); 89 WebMouseEventBuilder mouse(0, 0, *event);
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 = toWebViewImpl(FrameTestHelpers::createWebViewAndL oad(baseURL + fileName, true)); 99 FrameTestHelpers::WebViewHelper webViewHelper;
100 WebViewImpl* webViewImpl = toWebViewImpl(webViewHelper.initializeAndLoad(bas eURL + fileName, true));
100 webViewImpl->enableFixedLayoutMode(true); 101 webViewImpl->enableFixedLayoutMode(true);
101 webViewImpl->settings()->setViewportEnabled(true); 102 webViewImpl->settings()->setViewportEnabled(true);
102 int pageWidth = 640; 103 int pageWidth = 640;
103 int pageHeight = 480; 104 int pageHeight = 480;
104 webViewImpl->resize(WebSize(pageWidth, pageHeight)); 105 webViewImpl->resize(WebSize(pageWidth, pageHeight));
105 webViewImpl->layout(); 106 webViewImpl->layout();
106 107
107 webViewImpl->setPageScaleFactor(2, WebPoint()); 108 webViewImpl->setPageScaleFactor(2, WebPoint());
108 109
109 FrameView* view = webViewImpl->page()->mainFrame()->view(); 110 FrameView* view = webViewImpl->page()->mainFrame()->view();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 271
271 WebTouchEventBuilder webTouchBuilder(view, docRenderer, *touchEvent); 272 WebTouchEventBuilder webTouchBuilder(view, docRenderer, *touchEvent);
272 ASSERT_EQ(1u, webTouchBuilder.touchesLength); 273 ASSERT_EQ(1u, webTouchBuilder.touchesLength);
273 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x); 274 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x);
274 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y); 275 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y);
275 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); 276 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x);
276 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); 277 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y);
277 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); 278 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX);
278 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); 279 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY);
279 } 280 }
280
281 webViewImpl->close();
282 } 281 }
283 282
284 } // anonymous namespace 283 } // anonymous namespace
OLDNEW
« no previous file with comments | « Source/web/tests/WebFrameTest.cpp ('k') | Source/web/tests/WebPageNewSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698