| 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 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3594 EXPECT_TRUE(frame->document().focusedElement().isNull()); | 3594 EXPECT_TRUE(frame->document().focusedElement().isNull()); |
| 3595 | 3595 |
| 3596 // Find in an <input> value. | 3596 // Find in an <input> value. |
| 3597 EXPECT_TRUE(frame->find(findIdentifier, WebString::fromUTF8("bar2"), options
, false, 0)); | 3597 EXPECT_TRUE(frame->find(findIdentifier, WebString::fromUTF8("bar2"), options
, false, 0)); |
| 3598 // Confirm stopFinding(false) sets the selection on the found text. | 3598 // Confirm stopFinding(false) sets the selection on the found text. |
| 3599 frame->stopFinding(false); | 3599 frame->stopFinding(false); |
| 3600 range = frame->selectionRange(); | 3600 range = frame->selectionRange(); |
| 3601 ASSERT_FALSE(range.isNull()); | 3601 ASSERT_FALSE(range.isNull()); |
| 3602 EXPECT_EQ(5, range.startOffset()); | 3602 EXPECT_EQ(5, range.startOffset()); |
| 3603 EXPECT_EQ(9, range.endOffset()); | 3603 EXPECT_EQ(9, range.endOffset()); |
| 3604 EXPECT_EQ(WebString::fromUTF8("INPUT"), frame->document().focusedElement().t
agName()); | 3604 EXPECT_TRUE(frame->document().focusedElement().hasHTMLTagName("input")); |
| 3605 | 3605 |
| 3606 // Find in a <textarea> content. | 3606 // Find in a <textarea> content. |
| 3607 EXPECT_TRUE(frame->find(findIdentifier, WebString::fromUTF8("bar3"), options
, false, 0)); | 3607 EXPECT_TRUE(frame->find(findIdentifier, WebString::fromUTF8("bar3"), options
, false, 0)); |
| 3608 // Confirm stopFinding(false) sets the selection on the found text. | 3608 // Confirm stopFinding(false) sets the selection on the found text. |
| 3609 frame->stopFinding(false); | 3609 frame->stopFinding(false); |
| 3610 range = frame->selectionRange(); | 3610 range = frame->selectionRange(); |
| 3611 ASSERT_FALSE(range.isNull()); | 3611 ASSERT_FALSE(range.isNull()); |
| 3612 EXPECT_EQ(5, range.startOffset()); | 3612 EXPECT_EQ(5, range.startOffset()); |
| 3613 EXPECT_EQ(9, range.endOffset()); | 3613 EXPECT_EQ(9, range.endOffset()); |
| 3614 EXPECT_EQ(WebString::fromUTF8("TEXTAREA"), frame->document().focusedElement(
).tagName()); | 3614 EXPECT_TRUE(frame->document().focusedElement().hasHTMLTagName("textarea")); |
| 3615 | 3615 |
| 3616 // Find in a contentEditable element. | 3616 // Find in a contentEditable element. |
| 3617 EXPECT_TRUE(frame->find(findIdentifier, WebString::fromUTF8("bar4"), options
, false, 0)); | 3617 EXPECT_TRUE(frame->find(findIdentifier, WebString::fromUTF8("bar4"), options
, false, 0)); |
| 3618 // Confirm stopFinding(false) sets the selection on the found text. | 3618 // Confirm stopFinding(false) sets the selection on the found text. |
| 3619 frame->stopFinding(false); | 3619 frame->stopFinding(false); |
| 3620 range = frame->selectionRange(); | 3620 range = frame->selectionRange(); |
| 3621 ASSERT_FALSE(range.isNull()); | 3621 ASSERT_FALSE(range.isNull()); |
| 3622 EXPECT_EQ(0, range.startOffset()); | 3622 EXPECT_EQ(0, range.startOffset()); |
| 3623 EXPECT_EQ(4, range.endOffset()); | 3623 EXPECT_EQ(4, range.endOffset()); |
| 3624 // "bar4" is surrounded by <span>, but the focusable node should be the pare
nt <div>. | 3624 // "bar4" is surrounded by <span>, but the focusable node should be the pare
nt <div>. |
| 3625 EXPECT_EQ(WebString::fromUTF8("DIV"), frame->document().focusedElement().tag
Name()); | 3625 EXPECT_TRUE(frame->document().focusedElement().hasHTMLTagName("div")); |
| 3626 | 3626 |
| 3627 // Find in <select> content. | 3627 // Find in <select> content. |
| 3628 EXPECT_FALSE(frame->find(findIdentifier, WebString::fromUTF8("bar5"), option
s, false, 0)); | 3628 EXPECT_FALSE(frame->find(findIdentifier, WebString::fromUTF8("bar5"), option
s, false, 0)); |
| 3629 // If there are any matches, stopFinding will set the selection on the found
text. | 3629 // If there are any matches, stopFinding will set the selection on the found
text. |
| 3630 // However, we do not expect any matches, so check that the selection is nul
l. | 3630 // However, we do not expect any matches, so check that the selection is nul
l. |
| 3631 frame->stopFinding(false); | 3631 frame->stopFinding(false); |
| 3632 range = frame->selectionRange(); | 3632 range = frame->selectionRange(); |
| 3633 ASSERT_TRUE(range.isNull()); | 3633 ASSERT_TRUE(range.isNull()); |
| 3634 } | 3634 } |
| 3635 | 3635 |
| (...skipping 4566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8202 | 8202 |
| 8203 TEST_F(WebFrameTest, MaxFramesDetach) | 8203 TEST_F(WebFrameTest, MaxFramesDetach) |
| 8204 { | 8204 { |
| 8205 registerMockedHttpURLLoad("max-frames-detach.html"); | 8205 registerMockedHttpURLLoad("max-frames-detach.html"); |
| 8206 FrameTestHelpers::WebViewHelper webViewHelper; | 8206 FrameTestHelpers::WebViewHelper webViewHelper; |
| 8207 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 8207 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
| 8208 webViewImpl->mainFrameImpl()->collectGarbage(); | 8208 webViewImpl->mainFrameImpl()->collectGarbage(); |
| 8209 } | 8209 } |
| 8210 | 8210 |
| 8211 } // namespace blink | 8211 } // namespace blink |
| OLD | NEW |