Index: content/browser/web_contents/web_contents_impl_unittest.cc |
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc |
index 946cae8331386b9b77d58161533a0de4fb8539ca..4ec7e71cf04bbb625d934600d700635507f92f8c 100644 |
--- a/content/browser/web_contents/web_contents_impl_unittest.cc |
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc |
@@ -2274,6 +2274,29 @@ TEST_F(WebContentsImplTest, NoJSMessageOnInterstitials) { |
EXPECT_TRUE(contents()->last_dialog_suppressed_); |
} |
+// Tests that GetFocusedFrame() does not return NULL for an interstitial. |
+// This is is needed for copying from interstitials on OSX: crbug.com/415784 |
+TEST_F(WebContentsImplTest, CanGetFocusedFrameInInterstitial) { |
+ // Show an interstitial. |
+ TestInterstitialPage::InterstitialState state = |
+ TestInterstitialPage::INVALID; |
+ bool deleted = false; |
+ GURL interstitial_url("http://interstitial"); |
+ TestInterstitialPage* interstitial = |
+ new TestInterstitialPage(contents(), true, interstitial_url, |
+ &state, &deleted); |
+ TestInterstitialPageStateGuard state_guard(interstitial); |
+ interstitial->Show(); |
+ |
+ // Now let's make the interstitial navigation commit. |
+ interstitial->TestDidNavigate(1, interstitial_url); |
+ |
+ // Test that we can get GetFocusedFrame(). |
+ EXPECT_NE(nullptr, interstitial->GetAsWebContents()->GetFocusedFrame()); |
nasko
2015/04/22 05:07:45
Let's add accessor that exposes the associated Web
lgarron
2015/04/22 07:19:54
As of a week ago, InterstitialPageImpl has a prote
|
+ |
nasko
2015/04/22 05:07:45
I think we can another expectation here. The Rende
lgarron
2015/04/22 07:19:54
Done.
|
+ EXPECT_FALSE(deleted); |
+} |
+ |
// Makes sure that if the source passed to CopyStateFromAndPrune has an |
// interstitial it isn't copied over to the destination. |
TEST_F(WebContentsImplTest, CopyStateFromAndPruneSourceInterstitial) { |