Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chrome/browser/tab_contents/view_source_browsertest.cc

Issue 11753009: Simplify ExecuteJavaScript* functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update prerender_browsertest.cc. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/ui/browser_focus_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/ui/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698