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

Unified Diff: Source/web/tests/WebFrameTest.cpp

Issue 1343403004: Remove WebNode::remove(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebNode.cpp ('k') | public/web/WebNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 2ea914dcf633bdbefd3dd7fec1a736ce30f1fb0a..ff438801444331748fe30d90bf0a69b5b1d37855 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -257,6 +257,13 @@ protected:
return frame->nodeImage(*element);
}
+ void removeElementById(WebLocalFrameImpl* frame, const AtomicString& id)
+ {
+ Element* element = frame->frame()->document()->getElementById(id);
+ ASSERT(element);
+ element->remove();
+ }
+
std::string m_baseURL;
std::string m_notBaseURL;
std::string m_chromeURL;
@@ -3924,7 +3931,7 @@ TEST_P(ParameterizedWebFrameTest, FindOnDetachedFrame)
RefPtrWillBeRawPtr<LocalFrame> holdSecondFrame(secondFrame->frame());
// Detach the frame before finding.
- EXPECT_TRUE(mainFrame->document().getElementById("frame").remove());
+ removeElementById(mainFrame, "frame");
EXPECT_TRUE(mainFrame->find(kFindIdentifier, searchText, options, false, 0));
EXPECT_FALSE(secondFrame->find(kFindIdentifier, searchText, options, false, 0));
@@ -3969,7 +3976,7 @@ TEST_P(ParameterizedWebFrameTest, FindDetachFrameBeforeScopeStrings)
EXPECT_FALSE(client.findResultsAreReady());
// Detach the frame between finding and scoping.
- EXPECT_TRUE(mainFrame->document().getElementById("frame").remove());
+ removeElementById(mainFrame, "frame");
mainFrame->resetMatchCount();
@@ -4013,7 +4020,7 @@ TEST_P(ParameterizedWebFrameTest, FindDetachFrameWhileScopingStrings)
frame->scopeStringMatches(kFindIdentifier, searchText, options, true);
// The first scopeStringMatches will have reset the state. Detach before it actually scopes.
- EXPECT_TRUE(mainFrame->document().getElementById("frame").remove());
+ removeElementById(mainFrame, "frame");
runPendingTasks();
EXPECT_TRUE(client.findResultsAreReady());
« no previous file with comments | « Source/web/WebNode.cpp ('k') | public/web/WebNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698