OLD | NEW |
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 4380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4391 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); | 4391 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); |
4392 | 4392 |
4393 EXPECT_EQ(0, frame->frame()->selection().rootEditableElement()->scrollLeft()
); | 4393 EXPECT_EQ(0, frame->frame()->selection().rootEditableElement()->scrollLeft()
); |
4394 frame->moveRangeSelectionExtent(WebPoint(endWebRect.x + 500, endWebRect.y)); | 4394 frame->moveRangeSelectionExtent(WebPoint(endWebRect.x + 500, endWebRect.y)); |
4395 EXPECT_GE(frame->frame()->selection().rootEditableElement()->scrollLeft(), 1
); | 4395 EXPECT_GE(frame->frame()->selection().rootEditableElement()->scrollLeft(), 1
); |
4396 EXPECT_EQ("Lengthy text goes here.", selectionAsString(frame)); | 4396 EXPECT_EQ("Lengthy text goes here.", selectionAsString(frame)); |
4397 } | 4397 } |
4398 | 4398 |
4399 static int computeOffset(LayoutObject* layoutObject, int x, int y) | 4399 static int computeOffset(LayoutObject* layoutObject, int x, int y) |
4400 { | 4400 { |
4401 return createVisiblePositionDeprecated(layoutObject->positionForPoint(Layout
Point(x, y))).deepEquivalent().computeOffsetInContainerNode(); | 4401 return createVisiblePosition(layoutObject->positionForPoint(LayoutPoint(x, y
))).deepEquivalent().computeOffsetInContainerNode(); |
4402 } | 4402 } |
4403 | 4403 |
4404 // positionForPoint returns the wrong values for contenteditable spans. See | 4404 // positionForPoint returns the wrong values for contenteditable spans. See |
4405 // http://crbug.com/238334. | 4405 // http://crbug.com/238334. |
4406 TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest) | 4406 TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest) |
4407 { | 4407 { |
4408 registerMockedHttpURLLoad("select_range_span_editable.html"); | 4408 registerMockedHttpURLLoad("select_range_span_editable.html"); |
4409 FrameTestHelpers::WebViewHelper webViewHelper; | 4409 FrameTestHelpers::WebViewHelper webViewHelper; |
4410 initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html"
, &webViewHelper); | 4410 initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html"
, &webViewHelper); |
4411 WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl(); | 4411 WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl(); |
(...skipping 4526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8938 FrameTestHelpers::WebViewHelper helper; | 8938 FrameTestHelpers::WebViewHelper helper; |
8939 helper.initializeAndLoad(url, true); | 8939 helper.initializeAndLoad(url, true); |
8940 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); | 8940 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); |
8941 | 8941 |
8942 Document* document = toLocalFrame(helper.webView()->page()->mainFrame())->do
cument(); | 8942 Document* document = toLocalFrame(helper.webView()->page()->mainFrame())->do
cument(); |
8943 EXPECT_TRUE(document->isImageDocument()); | 8943 EXPECT_TRUE(document->isImageDocument()); |
8944 EXPECT_EQ(Resource::DecodeError, toImageDocument(document)->cachedImage()->g
etStatus()); | 8944 EXPECT_EQ(Resource::DecodeError, toImageDocument(document)->cachedImage()->g
etStatus()); |
8945 } | 8945 } |
8946 | 8946 |
8947 } // namespace blink | 8947 } // namespace blink |
OLD | NEW |