| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/dom_operation_notification_details.h" | 7 #include "chrome/browser/dom_operation_notification_details.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/tab_contents/chrome_interstitial_page.h" | 9 #include "chrome/browser/tab_contents/chrome_interstitial_page.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1707 TestInterstitialPageStateGuard state_guard(interstitial); | 1707 TestInterstitialPageStateGuard state_guard(interstitial); |
| 1708 interstitial->Show(); | 1708 interstitial->Show(); |
| 1709 interstitial->TestDidNavigate(1, kGURL); | 1709 interstitial->TestDidNavigate(1, kGURL); |
| 1710 | 1710 |
| 1711 // While the interstitial is showing, let's simulate the hidden page | 1711 // While the interstitial is showing, let's simulate the hidden page |
| 1712 // attempting to show a JS message. | 1712 // attempting to show a JS message. |
| 1713 IPC::Message* dummy_message = new IPC::Message; | 1713 IPC::Message* dummy_message = new IPC::Message; |
| 1714 bool did_suppress_message = false; | 1714 bool did_suppress_message = false; |
| 1715 contents()->RunJavaScriptMessage(contents()->render_view_host(), | 1715 contents()->RunJavaScriptMessage(contents()->render_view_host(), |
| 1716 ASCIIToUTF16("This is an informative message"), ASCIIToUTF16("OK"), | 1716 ASCIIToUTF16("This is an informative message"), ASCIIToUTF16("OK"), |
| 1717 kGURL, ui::MessageBoxFlags::kIsJavascriptAlert, dummy_message, | 1717 kGURL, ui::MESSAGE_BOX_IS_JAVASCRIPT_ALERT_DIALOG, dummy_message, |
| 1718 &did_suppress_message); | 1718 &did_suppress_message); |
| 1719 EXPECT_TRUE(did_suppress_message); | 1719 EXPECT_TRUE(did_suppress_message); |
| 1720 } | 1720 } |
| 1721 | 1721 |
| 1722 // Makes sure that if the source passed to CopyStateFromAndPrune has an | 1722 // Makes sure that if the source passed to CopyStateFromAndPrune has an |
| 1723 // interstitial it isn't copied over to the destination. | 1723 // interstitial it isn't copied over to the destination. |
| 1724 TEST_F(TabContentsTest, CopyStateFromAndPruneSourceInterstitial) { | 1724 TEST_F(TabContentsTest, CopyStateFromAndPruneSourceInterstitial) { |
| 1725 // Navigate to a page. | 1725 // Navigate to a page. |
| 1726 GURL url1("http://www.google.com"); | 1726 GURL url1("http://www.google.com"); |
| 1727 rvh()->SendNavigate(1, url1); | 1727 rvh()->SendNavigate(1, url1); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 | 1805 |
| 1806 // It should have a transient entry. | 1806 // It should have a transient entry. |
| 1807 EXPECT_TRUE(other_controller.GetTransientEntry()); | 1807 EXPECT_TRUE(other_controller.GetTransientEntry()); |
| 1808 | 1808 |
| 1809 // And the interstitial should be showing. | 1809 // And the interstitial should be showing. |
| 1810 EXPECT_TRUE(other_contents->showing_interstitial_page()); | 1810 EXPECT_TRUE(other_contents->showing_interstitial_page()); |
| 1811 | 1811 |
| 1812 // And the interstitial should do a reload on don't proceed. | 1812 // And the interstitial should do a reload on don't proceed. |
| 1813 EXPECT_TRUE(other_contents->interstitial_page()->reload_on_dont_proceed()); | 1813 EXPECT_TRUE(other_contents->interstitial_page()->reload_on_dont_proceed()); |
| 1814 } | 1814 } |
| OLD | NEW |