| 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 5101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5112 WebRect startWebRect; | 5112 WebRect startWebRect; |
| 5113 WebRect endWebRect; | 5113 WebRect endWebRect; |
| 5114 | 5114 |
| 5115 registerMockedHttpURLLoad("select_range_basic.html"); | 5115 registerMockedHttpURLLoad("select_range_basic.html"); |
| 5116 registerMockedHttpURLLoad("select_range_scroll.html"); | 5116 registerMockedHttpURLLoad("select_range_scroll.html"); |
| 5117 | 5117 |
| 5118 FrameTestHelpers::WebViewHelper webViewHelper; | 5118 FrameTestHelpers::WebViewHelper webViewHelper; |
| 5119 initializeTextSelectionWebView(m_baseURL + "select_range_basic.html", | 5119 initializeTextSelectionWebView(m_baseURL + "select_range_basic.html", |
| 5120 &webViewHelper); | 5120 &webViewHelper); |
| 5121 frame = webViewHelper.webView()->mainFrameImpl(); | 5121 frame = webViewHelper.webView()->mainFrameImpl(); |
| 5122 EXPECT_EQ("Some test text for testing.", selectionAsString(frame)); | 5122 // TODO(yosin): Since selection is canonicalized with size(0, 0) window, |
| 5123 // we should hold original range. |
| 5124 EXPECT_EQ(" Some test text for testing.", selectionAsString(frame)); |
| 5123 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); | 5125 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); |
| 5124 frame->executeCommand(WebString::fromUTF8("Unselect")); | 5126 frame->executeCommand(WebString::fromUTF8("Unselect")); |
| 5125 EXPECT_EQ("", selectionAsString(frame)); | 5127 EXPECT_EQ("", selectionAsString(frame)); |
| 5126 frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect)); | 5128 frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect)); |
| 5127 // On some devices, the above bottomRightMinusOne() causes the ending '.' not | 5129 // On some devices, the above bottomRightMinusOne() causes the ending '.' not |
| 5128 // selected. | 5130 // selected. |
| 5129 std::string selectionString = selectionAsString(frame); | 5131 std::string selectionString = selectionAsString(frame); |
| 5130 EXPECT_TRUE(selectionString == "Some test text for testing." || | 5132 EXPECT_TRUE(selectionString == " Some test text for testing." || |
| 5131 selectionString == "Some test text for testing"); | 5133 selectionString == " Some test text for testing"); |
| 5132 | 5134 |
| 5133 initializeTextSelectionWebView(m_baseURL + "select_range_scroll.html", | 5135 initializeTextSelectionWebView(m_baseURL + "select_range_scroll.html", |
| 5134 &webViewHelper); | 5136 &webViewHelper); |
| 5135 frame = webViewHelper.webView()->mainFrameImpl(); | 5137 frame = webViewHelper.webView()->mainFrameImpl(); |
| 5136 EXPECT_EQ("Some offscreen test text for testing.", selectionAsString(frame)); | 5138 EXPECT_EQ("Some offscreen test text for testing.", selectionAsString(frame)); |
| 5137 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); | 5139 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); |
| 5138 frame->executeCommand(WebString::fromUTF8("Unselect")); | 5140 frame->executeCommand(WebString::fromUTF8("Unselect")); |
| 5139 EXPECT_EQ("", selectionAsString(frame)); | 5141 EXPECT_EQ("", selectionAsString(frame)); |
| 5140 frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect)); | 5142 frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect)); |
| 5141 // On some devices, the above bottomRightMinusOne() causes the ending '.' not | 5143 // On some devices, the above bottomRightMinusOne() causes the ending '.' not |
| (...skipping 6091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11233 | 11235 |
| 11234 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 11236 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 11235 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 11237 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 11236 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 11238 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 11237 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 11239 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 11238 | 11240 |
| 11239 webViewHelper.reset(); | 11241 webViewHelper.reset(); |
| 11240 } | 11242 } |
| 11241 | 11243 |
| 11242 } // namespace blink | 11244 } // namespace blink |
| OLD | NEW |