diff options
author | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 15:09:01 +0000 |
---|---|---|
committer | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 15:09:01 +0000 |
commit | 6a914a59965413063517489060131b1627e6fdff (patch) | |
tree | 27d301e7365e335798b3aa7893c8594b95964242 /chrome/browser/debugger | |
parent | 5d282b13a284b8217240fb5156251dc23aaaf944 (diff) | |
download | chromium_src-6a914a59965413063517489060131b1627e6fdff.zip chromium_src-6a914a59965413063517489060131b1627e6fdff.tar.gz chromium_src-6a914a59965413063517489060131b1627e6fdff.tar.bz2 |
DevTools Profiler: add sanity test.
Add a test that opens a page which executes JS, profiles it, and checks the result displayed.
BUG=none
TEST=chrome\browser\debugger\devtools_sanity_unittest.cc
Review URL: http://codereview.chromium.org/147204
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19360 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger')
-rw-r--r-- | chrome/browser/debugger/devtools_sanity_unittest.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index 8e7deb5..cafd3c4 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -42,6 +42,7 @@ class BrowserClosedObserver : public NotificationObserver { const int kActionDelayMs = 500; const wchar_t kSimplePage[] = L"files/devtools/simple_page.html"; +const wchar_t kJsPage[] = L"files/devtools/js_page.html"; class DevToolsSanityTest : public InProcessBrowserTest { public: @@ -51,8 +52,8 @@ class DevToolsSanityTest : public InProcessBrowserTest { } protected: - void RunTest(const std::string& test_name) { - OpenDevToolsWindow(); + void RunTest(const std::string& test_name, const std::wstring& test_page) { + OpenDevToolsWindow(test_page); std::string result; ASSERT_TRUE( ui_test_utils::ExecuteJavaScriptAndExtractString( @@ -64,9 +65,9 @@ class DevToolsSanityTest : public InProcessBrowserTest { CloseDevToolsWindow(); } - void OpenDevToolsWindow() { + void OpenDevToolsWindow(const std::wstring& test_page) { HTTPTestServer* server = StartHTTPServer(); - GURL url = server->TestServerPageW(kSimplePage); + GURL url = server->TestServerPageW(test_page); ui_test_utils::NavigateToURL(browser(), url); TabContents* tab = browser()->GetTabContentsAt(0); @@ -95,22 +96,27 @@ class DevToolsSanityTest : public InProcessBrowserTest { // WebInspector opens. IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestHostIsPresent) { - RunTest("testHostIsPresent"); + RunTest("testHostIsPresent", kSimplePage); } // Tests elements panel basics. IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestElementsTreeRoot) { - RunTest("testElementsTreeRoot"); + RunTest("testElementsTreeRoot", kSimplePage); } // Tests main resource load. IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestMainResource) { - RunTest("testMainResource"); + RunTest("testMainResource", kSimplePage); } // Tests resources panel enabling. IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEnableResourcesTab) { - RunTest("testEnableResourcesTab"); + RunTest("testEnableResourcesTab", kSimplePage); +} + +// Tests profiler panel. +IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestProfilerTab) { + RunTest("testProfilerTab", kJsPage); } } // namespace |