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

Side by Side Diff: webkit/glue/webframe_unittest.cc

Issue 164565: Remove WebFrame::selectAll and WebFrame::clearSelection in favor of executeCommand (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | webkit/glue/webview_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/string_util.h" 5 #include "base/string_util.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "webkit/api/public/WebData.h" 7 #include "webkit/api/public/WebData.h"
8 #include "webkit/api/public/WebFrame.h" 8 #include "webkit/api/public/WebFrame.h"
9 #include "webkit/api/public/WebString.h" 9 #include "webkit/api/public/WebString.h"
10 #include "webkit/api/public/WebURL.h" 10 #include "webkit/api/public/WebURL.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 frame->loadHTMLString(html, test_url); 78 frame->loadHTMLString(html, test_url);
79 test_shell_->WaitTestFinished(); 79 test_shell_->WaitTestFinished();
80 80
81 EXPECT_EQ(html, UTF16ToUTF8(frame->contentAsMarkup())); 81 EXPECT_EQ(html, UTF16ToUTF8(frame->contentAsMarkup()));
82 82
83 text = frame->contentAsText(std::numeric_limits<size_t>::max()); 83 text = frame->contentAsText(std::numeric_limits<size_t>::max());
84 EXPECT_EQ("Hello\n\nWorld", UTF16ToUTF8(text)); 84 EXPECT_EQ("Hello\n\nWorld", UTF16ToUTF8(text));
85 85
86 // Test selection check 86 // Test selection check
87 EXPECT_FALSE(frame->hasSelection()); 87 EXPECT_FALSE(frame->hasSelection());
88 frame->selectAll(); 88 frame->executeCommand(WebString::fromUTF8("SelectAll"));
89 EXPECT_TRUE(frame->hasSelection()); 89 EXPECT_TRUE(frame->hasSelection());
90 frame->clearSelection(); 90 frame->executeCommand(WebString::fromUTF8("Unselect"));
91 EXPECT_FALSE(frame->hasSelection()); 91 EXPECT_FALSE(frame->hasSelection());
92 WebString selection_html = frame->selectionAsMarkup(); 92 WebString selection_html = frame->selectionAsMarkup();
93 EXPECT_TRUE(selection_html.isEmpty()); 93 EXPECT_TRUE(selection_html.isEmpty());
94 } 94 }
OLDNEW
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | webkit/glue/webview_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698