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

Side by Side Diff: third_party/WebKit/Source/web/tests/TouchActionTest.cpp

Issue 2869803003: Change from ClientRect to DOMRect.
Patch Set: Change from ClientRect to DOMRect. Created 3 years, 6 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 | « third_party/WebKit/Source/web/tests/ScrollMetricsTest.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) 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 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/dom/ClientRect.h"
32 #include "core/dom/ClientRectList.h" 31 #include "core/dom/ClientRectList.h"
33 #include "core/dom/Document.h" 32 #include "core/dom/Document.h"
34 #include "core/dom/Element.h" 33 #include "core/dom/Element.h"
35 #include "core/dom/StaticNodeList.h" 34 #include "core/dom/StaticNodeList.h"
36 #include "core/dom/shadow/ShadowRoot.h" 35 #include "core/dom/shadow/ShadowRoot.h"
37 #include "core/exported/WebViewBase.h" 36 #include "core/exported/WebViewBase.h"
38 #include "core/frame/FrameTestHelpers.h" 37 #include "core/frame/FrameTestHelpers.h"
39 #include "core/frame/LocalFrame.h" 38 #include "core/frame/LocalFrame.h"
40 #include "core/frame/LocalFrameView.h" 39 #include "core/frame/LocalFrameView.h"
40 #include "core/geometry/DOMRect.h"
41 #include "core/html/HTMLIFrameElement.h" 41 #include "core/html/HTMLIFrameElement.h"
42 #include "core/input/EventHandler.h" 42 #include "core/input/EventHandler.h"
43 #include "core/layout/HitTestResult.h" 43 #include "core/layout/HitTestResult.h"
44 #include "core/layout/LayoutTreeAsText.h" 44 #include "core/layout/LayoutTreeAsText.h"
45 #include "core/layout/api/LayoutViewItem.h" 45 #include "core/layout/api/LayoutViewItem.h"
46 #include "platform/graphics/TouchAction.h" 46 #include "platform/graphics/TouchAction.h"
47 #include "platform/testing/URLTestHelpers.h" 47 #include "platform/testing/URLTestHelpers.h"
48 #include "platform/testing/UnitTestHelpers.h" 48 #include "platform/testing/UnitTestHelpers.h"
49 #include "public/platform/Platform.h" 49 #include "public/platform/Platform.h"
50 #include "public/platform/WebCoalescedInputEvent.h" 50 #include "public/platform/WebCoalescedInputEvent.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 failure_context += "<missing ID>"; 260 failure_context += "<missing ID>";
261 } 261 }
262 262
263 // Run each test three times at different positions in the element. 263 // Run each test three times at different positions in the element.
264 // Note that we don't want the bounding box because our tests sometimes have 264 // Note that we don't want the bounding box because our tests sometimes have
265 // elements with multiple border boxes with other elements in between. Use 265 // elements with multiple border boxes with other elements in between. Use
266 // the first border box (which we can easily visualize in a browser for 266 // the first border box (which we can easily visualize in a browser for
267 // debugging). 267 // debugging).
268 Persistent<ClientRectList> rects = element->getClientRects(); 268 Persistent<ClientRectList> rects = element->getClientRects();
269 ASSERT_GE(rects->length(), 0u) << failure_context; 269 ASSERT_GE(rects->length(), 0u) << failure_context;
270 Persistent<ClientRect> r = rects->item(0); 270 Persistent<DOMRect> r = rects->item(0);
271 FloatRect client_float_rect = 271 FloatRect client_float_rect =
272 FloatRect(r->left(), r->top(), r->width(), r->height()); 272 FloatRect(r->left(), r->top(), r->width(), r->height());
273 IntRect client_rect = EnclosedIntRect(client_float_rect); 273 IntRect client_rect = EnclosedIntRect(client_float_rect);
274 for (int loc_idx = 0; loc_idx < 3; loc_idx++) { 274 for (int loc_idx = 0; loc_idx < 3; loc_idx++) {
275 IntPoint frame_point; 275 IntPoint frame_point;
276 std::stringstream context_stream; 276 std::stringstream context_stream;
277 context_stream << failure_context << " ("; 277 context_stream << failure_context << " (";
278 switch (loc_idx) { 278 switch (loc_idx) {
279 case 0: 279 case 0:
280 frame_point = client_rect.Center(); 280 frame_point = client_rect.Center();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 418
419 TEST_F(TouchActionTest, ShadowDOM) { 419 TEST_F(TouchActionTest, ShadowDOM) {
420 RunShadowDOMTest("touch-action-shadow-dom.html"); 420 RunShadowDOMTest("touch-action-shadow-dom.html");
421 } 421 }
422 422
423 TEST_F(TouchActionTest, Pan) { 423 TEST_F(TouchActionTest, Pan) {
424 RunTouchActionTest("touch-action-pan.html"); 424 RunTouchActionTest("touch-action-pan.html");
425 } 425 }
426 426
427 } // namespace blink 427 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/ScrollMetricsTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698