| Index: content/browser/frame_host/interstitial_page_impl_browsertest.cc
|
| diff --git a/content/browser/frame_host/interstitial_page_impl_browsertest.cc b/content/browser/frame_host/interstitial_page_impl_browsertest.cc
|
| index acd83df94c3c09732e4bd2e9996a4585f0902af2..2fbdda35c986c6b0713dec2372b10bcd0c633447 100644
|
| --- a/content/browser/frame_host/interstitial_page_impl_browsertest.cc
|
| +++ b/content/browser/frame_host/interstitial_page_impl_browsertest.cc
|
| @@ -53,6 +53,10 @@ class TestInterstitialPageDelegate : public InterstitialPageDelegate {
|
| " window.domAutomationController.send("
|
| " window.getSelection().toString());"
|
| "}"
|
| + "function set_selection_change_listener() {"
|
| + " document.addEventListener('selectionchange',"
|
| + " function() { document.title='SELECTION_CHANGED'; })"
|
| + "}"
|
| "</script>"
|
| "</head>"
|
| "<body>original body text</body>"
|
| @@ -281,6 +285,11 @@ class InterstitialPageImplTest : public ContentBrowserTest {
|
| "create_input_and_set_text('" + text + "')");
|
| }
|
|
|
| + bool SetSelectionChangeListener() {
|
| + return ExecuteScript(interstitial_->GetMainFrame(),
|
| + "set_selection_change_listener()");
|
| + }
|
| +
|
| std::string PerformCut() {
|
| clipboard_message_watcher_->InitWait();
|
| title_update_watcher_->InitWait("TEXT_CHANGED");
|
| @@ -310,9 +319,11 @@ class InterstitialPageImplTest : public ContentBrowserTest {
|
| }
|
|
|
| void PerformSelectAll() {
|
| + title_update_watcher_->InitWait("SELECTION_CHANGED");
|
| RenderFrameHostImpl* rfh =
|
| static_cast<RenderFrameHostImpl*>(interstitial_->GetMainFrame());
|
| rfh->GetRenderWidgetHost()->delegate()->SelectAll();
|
| + title_update_watcher_->Wait();
|
| }
|
|
|
| private:
|
| @@ -391,12 +402,14 @@ IN_PROC_BROWSER_TEST_F(InterstitialPageImplTest, Paste) {
|
|
|
| IN_PROC_BROWSER_TEST_F(InterstitialPageImplTest, SelectAll) {
|
| SetUpInterstitialPage();
|
| + ASSERT_TRUE(SetSelectionChangeListener());
|
|
|
| std::string input_text;
|
| ASSERT_TRUE(GetSelection(&input_text));
|
| EXPECT_EQ(std::string(), input_text);
|
|
|
| PerformSelectAll();
|
| +
|
| ASSERT_TRUE(GetSelection(&input_text));
|
| EXPECT_EQ("original body text", input_text);
|
|
|
|
|