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

Unified Diff: chrome/browser/devtools/devtools_sanity_browsertest.cc

Issue 12574007: Merge 186793 "Let the browser handle external navigations from D..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_sanity_browsertest.cc
===================================================================
--- chrome/browser/devtools/devtools_sanity_browsertest.cc (revision 187956)
+++ chrome/browser/devtools/devtools_sanity_browsertest.cc (working copy)
@@ -22,6 +22,7 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/child_process_data.h"
@@ -504,6 +505,25 @@
RunTest("testConsoleOnNavigateBack", kNavigateBackTestPage);
}
+
+// Tests that external navigation from inspector page is always handled by
+// DevToolsWindow and results in inspected page navigation.
+IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDevToolsExternalNavigation) {
+ OpenDevToolsWindow(kDebuggerTestPage);
+ GURL url = test_server()->GetURL(kNavigateBackTestPage);
+ content::WindowedNotificationObserver observer(
+ content::NOTIFICATION_LOAD_STOP,
+ content::NotificationService::AllSources());
+ ASSERT_TRUE(content::ExecuteScript(
+ window_->web_contents(),
+ std::string("window.location = \"") + url.spec() + "\""));
+ observer.Wait();
+
+ ASSERT_TRUE(window_->web_contents()->GetURL().
+ SchemeIs(chrome::kChromeDevToolsScheme));
+ ASSERT_EQ(GetInspectedTab()->GetURL(), url);
+}
+
// Tests that inspector will reattach to inspected page when it is reloaded
// after a crash. See http://crbug.com/101952
IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestReattachAfterCrash) {
« no previous file with comments | « no previous file | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698