| 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/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
| 12 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 13 #include "chrome/test/testing_pref_service.h" | 14 #include "chrome/test/testing_pref_service.h" |
| 14 #include "chrome/test/testing_profile.h" | 15 #include "chrome/test/testing_profile.h" |
| 15 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" |
| 16 #include "content/browser/renderer_host/render_view_host.h" | 17 #include "content/browser/renderer_host/render_view_host.h" |
| 17 #include "content/browser/renderer_host/render_widget_host_view.h" | 18 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 18 #include "content/browser/renderer_host/test_render_view_host.h" | 19 #include "content/browser/renderer_host/test_render_view_host.h" |
| 19 #include "content/browser/site_instance.h" | 20 #include "content/browser/site_instance.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 *state_ = OKED; | 89 *state_ = OKED; |
| 89 InterstitialPage::Proceed(); | 90 InterstitialPage::Proceed(); |
| 90 } | 91 } |
| 91 | 92 |
| 92 int command_received_count() const { | 93 int command_received_count() const { |
| 93 return command_received_count_; | 94 return command_received_count_; |
| 94 } | 95 } |
| 95 | 96 |
| 96 void TestDomOperationResponse(const std::string& json_string) { | 97 void TestDomOperationResponse(const std::string& json_string) { |
| 97 DomOperationNotificationDetails details(json_string, 1); | 98 DomOperationNotificationDetails details(json_string, 1); |
| 98 Observe(NotificationType::DOM_OPERATION_RESPONSE, | 99 Observe(chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, |
| 99 Source<RenderViewHost>(render_view_host()), | 100 Source<RenderViewHost>(render_view_host()), |
| 100 Details<DomOperationNotificationDetails>(&details)); | 101 Details<DomOperationNotificationDetails>(&details)); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void TestDidNavigate(int page_id, const GURL& url) { | 104 void TestDidNavigate(int page_id, const GURL& url) { |
| 104 ViewHostMsg_FrameNavigate_Params params; | 105 ViewHostMsg_FrameNavigate_Params params; |
| 105 InitNavigateParams(¶ms, page_id, url, PageTransition::TYPED); | 106 InitNavigateParams(¶ms, page_id, url, PageTransition::TYPED); |
| 106 DidNavigate(render_view_host(), params); | 107 DidNavigate(render_view_host(), params); |
| 107 } | 108 } |
| 108 | 109 |
| (...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 window.close_count = 0; | 1753 window.close_count = 0; |
| 1753 | 1754 |
| 1754 const int kWindowCount = 4; | 1755 const int kWindowCount = 4; |
| 1755 for (int i = 0; i < kWindowCount; i++) { | 1756 for (int i = 0; i < kWindowCount; i++) { |
| 1756 tab_contents->AddConstrainedDialog(&window); | 1757 tab_contents->AddConstrainedDialog(&window); |
| 1757 } | 1758 } |
| 1758 EXPECT_EQ(window.close_count, 0); | 1759 EXPECT_EQ(window.close_count, 0); |
| 1759 delete tab_contents; | 1760 delete tab_contents; |
| 1760 EXPECT_EQ(window.close_count, kWindowCount); | 1761 EXPECT_EQ(window.close_count, kWindowCount); |
| 1761 } | 1762 } |
| OLD | NEW |