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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 GURL url_viewsource(chrome::kViewSourceScheme + std::string(":") + | 97 GURL url_viewsource(chrome::kViewSourceScheme + std::string(":") + |
98 test_server()->GetURL(kTestHtml).spec()); | 98 test_server()->GetURL(kTestHtml).spec()); |
99 | 99 |
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 ASSERT_TRUE(content::ExecuteScript(chrome::GetWebContentsAt(browser(), 0), |
107 chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(); | 107 "window.location.reload();")); |
108 | |
109 ASSERT_TRUE( | |
110 content::ExecuteJavaScript(rvh, "", "window.location.reload();")); | |
111 | 108 |
112 content::WindowedNotificationObserver observer2( | 109 content::WindowedNotificationObserver observer2( |
113 content::NOTIFICATION_LOAD_STOP, | 110 content::NOTIFICATION_LOAD_STOP, |
114 content::NotificationService::AllSources()); | 111 content::NotificationService::AllSources()); |
115 observer2.Wait(); | 112 observer2.Wait(); |
116 ASSERT_TRUE(chrome::GetWebContentsAt(browser(), 0)->GetController(). | 113 ASSERT_TRUE(chrome::GetWebContentsAt(browser(), 0)->GetController(). |
117 GetActiveEntry()->IsViewSourceMode()); | 114 GetActiveEntry()->IsViewSourceMode()); |
118 } | 115 } |
OLD | NEW |