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

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

Issue 1326563002: Introduce visiblePositionOf() with PositionWithAffinity as replacement of VisiblePosition constructo (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-01T10:55:04 Created 5 years, 3 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/WebSurroundingText.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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 4405 matching lines...) Expand 10 before | Expand all | Expand 10 after
4416 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); 4416 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
4417 4417
4418 EXPECT_EQ(0, frame->frame()->selection().rootEditableElement()->scrollLeft() ); 4418 EXPECT_EQ(0, frame->frame()->selection().rootEditableElement()->scrollLeft() );
4419 frame->moveRangeSelectionExtent(WebPoint(endWebRect.x + 500, endWebRect.y)); 4419 frame->moveRangeSelectionExtent(WebPoint(endWebRect.x + 500, endWebRect.y));
4420 EXPECT_GE(frame->frame()->selection().rootEditableElement()->scrollLeft(), 1 ); 4420 EXPECT_GE(frame->frame()->selection().rootEditableElement()->scrollLeft(), 1 );
4421 EXPECT_EQ("Lengthy text goes here.", selectionAsString(frame)); 4421 EXPECT_EQ("Lengthy text goes here.", selectionAsString(frame));
4422 } 4422 }
4423 4423
4424 static int computeOffset(LayoutObject* layoutObject, int x, int y) 4424 static int computeOffset(LayoutObject* layoutObject, int x, int y)
4425 { 4425 {
4426 return VisiblePosition(layoutObject->positionForPoint(LayoutPoint(x, y))).de epEquivalent().computeOffsetInContainerNode(); 4426 return visiblePositionOf(layoutObject->positionForPoint(LayoutPoint(x, y))). deepEquivalent().computeOffsetInContainerNode();
4427 } 4427 }
4428 4428
4429 // positionForPoint returns the wrong values for contenteditable spans. See 4429 // positionForPoint returns the wrong values for contenteditable spans. See
4430 // http://crbug.com/238334. 4430 // http://crbug.com/238334.
4431 TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest) 4431 TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest)
4432 { 4432 {
4433 registerMockedHttpURLLoad("select_range_span_editable.html"); 4433 registerMockedHttpURLLoad("select_range_span_editable.html");
4434 FrameTestHelpers::WebViewHelper webViewHelper(this); 4434 FrameTestHelpers::WebViewHelper webViewHelper(this);
4435 initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html" , &webViewHelper); 4435 initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html" , &webViewHelper);
4436 WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()-> mainFrame()); 4436 WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()-> mainFrame());
(...skipping 3633 matching lines...) Expand 10 before | Expand all | Expand 10 after
8070 8070
8071 TEST_F(WebFrameTest, MaxFramesDetach) 8071 TEST_F(WebFrameTest, MaxFramesDetach)
8072 { 8072 {
8073 registerMockedHttpURLLoad("max-frames-detach.html"); 8073 registerMockedHttpURLLoad("max-frames-detach.html");
8074 FrameTestHelpers::WebViewHelper webViewHelper; 8074 FrameTestHelpers::WebViewHelper webViewHelper;
8075 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true); 8075 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true);
8076 webViewImpl->mainFrameImpl()->collectGarbage(); 8076 webViewImpl->mainFrameImpl()->collectGarbage();
8077 } 8077 }
8078 8078
8079 } // namespace blink 8079 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebSurroundingText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698