OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/app/chrome_command_ids.h" | 6 #include "chrome/app/chrome_command_ids.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_commands.h" | 8 #include "chrome/browser/ui/browser_commands.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 content::WindowedNotificationObserver observer( | 100 content::WindowedNotificationObserver observer( |
101 content::NOTIFICATION_LOAD_STOP, | 101 content::NOTIFICATION_LOAD_STOP, |
102 content::NotificationService::AllSources()); | 102 content::NotificationService::AllSources()); |
103 ui_test_utils::NavigateToURL(browser(), url_viewsource); | 103 ui_test_utils::NavigateToURL(browser(), url_viewsource); |
104 observer.Wait(); | 104 observer.Wait(); |
105 | 105 |
106 content::RenderViewHost* rvh = | 106 content::RenderViewHost* rvh = |
107 chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(); | 107 chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(); |
108 | 108 |
109 ASSERT_TRUE( | 109 ASSERT_TRUE( |
110 content::ExecuteJavaScript(rvh, | 110 content::ExecuteJavaScript(rvh, "", "window.location.reload();")); |
111 L"", | |
112 L"window.location.reload();")); | |
113 | 111 |
114 content::WindowedNotificationObserver observer2( | 112 content::WindowedNotificationObserver observer2( |
115 content::NOTIFICATION_LOAD_STOP, | 113 content::NOTIFICATION_LOAD_STOP, |
116 content::NotificationService::AllSources()); | 114 content::NotificationService::AllSources()); |
117 observer2.Wait(); | 115 observer2.Wait(); |
118 ASSERT_TRUE(chrome::GetWebContentsAt(browser(), 0)->GetController(). | 116 ASSERT_TRUE(chrome::GetWebContentsAt(browser(), 0)->GetController(). |
119 GetActiveEntry()->IsViewSourceMode()); | 117 GetActiveEntry()->IsViewSourceMode()); |
120 } | 118 } |
OLD | NEW |