summaryrefslogtreecommitdiffstats
path: root/chrome/browser/debugger/devtools_sanity_unittest.cc
diff options
context:
space:
mode:
authoryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-31 08:42:21 +0000
committeryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-31 08:42:21 +0000
commit13a6abf8b496b855d14b281cd2af1095b179be1c (patch)
tree9df30608a7b79bd7af5f81fc341150e17b63fd0c /chrome/browser/debugger/devtools_sanity_unittest.cc
parentef4d0aed4a2702fbd6478b9903f745cc555d930f (diff)
downloadchromium_src-13a6abf8b496b855d14b281cd2af1095b179be1c.zip
chromium_src-13a6abf8b496b855d14b281cd2af1095b179be1c.tar.gz
chromium_src-13a6abf8b496b855d14b281cd2af1095b179be1c.tar.bz2
DevTools: add all scripts from afterCompile events when scripts panel is shown for the first timeBUG=26312
TEST=DevToolsSanityTest.TestScriptsTabIsPopulatedOnInspectedPageRefresh Review URL: http://codereview.chromium.org/341057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger/devtools_sanity_unittest.cc')
-rw-r--r--chrome/browser/debugger/devtools_sanity_unittest.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc
index a3fb609..8329273 100644
--- a/chrome/browser/debugger/devtools_sanity_unittest.cc
+++ b/chrome/browser/debugger/devtools_sanity_unittest.cc
@@ -108,8 +108,7 @@ class DevToolsSanityTest : public InProcessBrowserTest {
GURL url = server->TestServerPageW(test_page);
ui_test_utils::NavigateToURL(browser(), url);
- TabContents* tab = browser()->GetTabContentsAt(0);
- inspected_rvh_ = tab->render_view_host();
+ inspected_rvh_ = GetInspectedTab()->render_view_host();
DevToolsManager* devtools_manager = DevToolsManager::GetInstance();
devtools_manager->OpenDevToolsWindow(inspected_rvh_);
@@ -121,6 +120,10 @@ class DevToolsSanityTest : public InProcessBrowserTest {
ui_test_utils::WaitForNavigation(&client_contents_->controller());
}
+ TabContents* GetInspectedTab() {
+ return browser()->GetTabContentsAt(0);
+ }
+
void CloseDevToolsWindow() {
DevToolsManager* devtools_manager = DevToolsManager::GetInstance();
// UnregisterDevToolsClientHostFor may destroy window_ so store the browser
@@ -282,6 +285,20 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) {
RunTest("testShowScriptsTab", kDebuggerTestPage);
}
+// Tests that scripts tab is populated with inspected scripts even if it
+// hadn't been shown by the moment inspected paged refreshed.
+// @see http://crbug.com/26312
+IN_PROC_BROWSER_TEST_F(DevToolsSanityTest,
+ TestScriptsTabIsPopulatedOnInspectedPageRefresh) {
+ // Reset inspector settings to defaults to ensure that Elements will be
+ // current panel when DevTools window is open.
+ GetInspectedTab()->render_view_host()->delegate()->UpdateInspectorSettings(
+ WebPreferences().inspector_settings);
+ RunTest("testScriptsTabIsPopulatedOnInspectedPageRefresh",
+ kDebuggerTestPage);
+}
+
+
// Tests that a content script is in the scripts list.
IN_PROC_BROWSER_TEST_F(DevToolsExtensionDebugTest,
TestContentScriptIsPresent) {