diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 10:51:23 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 10:51:23 +0000 |
commit | ac863a026dcce485a87698d0489c05e4c2baf889 (patch) | |
tree | 07b87bc3392dd64ce64dff9fef890b20c0d713f8 /webkit/tools/test_shell/test_shell_win.cc | |
parent | 060d4d8b30d19a4b5113ee4ceeefd49df0407967 (diff) | |
download | chromium_src-ac863a026dcce485a87698d0489c05e4c2baf889.zip chromium_src-ac863a026dcce485a87698d0489c05e4c2baf889.tar.gz chromium_src-ac863a026dcce485a87698d0489c05e4c2baf889.tar.bz2 |
DevTools: Add support for inspector layout tests. Step 3.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell_win.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell_win.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index d038757..2de1695 100644 --- a/webkit/tools/test_shell/test_shell_win.cc +++ b/webkit/tools/test_shell/test_shell_win.cc @@ -252,6 +252,10 @@ bool TestShell::RunFileTest(const TestParams& params) { shell = static_cast<TestShell*>(win_util::GetWindowUserData(hwnd)); DCHECK(shell); + if (strstr(params.test_url.c_str(), "/inspector/") || + strstr(params.test_url.c_str(), "\\inspector\\")) + inspector_test_mode_ = true; + // Clean up state between test runs. webkit_glue::ResetBeforeTestRun(shell->webView()); ResetWebPreferences(); @@ -266,6 +270,9 @@ bool TestShell::RunFileTest(const TestParams& params) { strstr(params.test_url.c_str(), "loading\\")) shell->layout_test_controller()->SetShouldDumpFrameLoadCallbacks(true); + if (inspector_test_mode_) + shell->ShowDevTools(); + shell->test_is_preparing_ = true; shell->set_test_params(¶ms); shell->LoadURL(GURL(params.test_url)); @@ -274,7 +281,6 @@ bool TestShell::RunFileTest(const TestParams& params) { shell->WaitTestFinished(); shell->set_test_params(NULL); - return true; } @@ -361,6 +367,8 @@ bool TestShell::Initialize(const GURL& starting_url) { WebViewHost::Create(m_mainWnd, delegate_.get(), *TestShell::web_prefs_)); delegate_->RegisterDragDrop(); + InitializeDevToolsAgent(webView()); + // Load our initial content. if (starting_url.is_valid()) LoadURL(starting_url); @@ -557,19 +565,23 @@ LRESULT CALLBACK TestShell::WndProc(HWND hwnd, UINT message, WPARAM wParam, case IDM_DUMP_RENDER_TREE: shell->DumpRenderTree(); break; + case IDM_SHOW_DEV_TOOLS: + shell->ShowDevTools(); + break; } } break; case WM_DESTROY: { - // Dump all in use memory just before shutdown if in use memory - // debugging has been enabled. - base::MemoryDebug::DumpAllMemoryInUse(); RemoveWindowFromList(hwnd); if (TestShell::windowList()->empty() || shell->is_modal()) { + // Dump all in use memory just before shutdown if in use memory + // debugging has been enabled. + base::MemoryDebug::DumpAllMemoryInUse(); + MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); } @@ -725,6 +737,9 @@ base::StringPiece GetDataResource(int resource_id) { case IDR_MEDIA_SOUND_DISABLED: case IDR_MEDIA_SLIDER_THUMB: case IDR_MEDIA_VOLUME_SLIDER_THUMB: + case IDR_DEVTOOLS_INJECT_WEBKIT_JS: + case IDR_DEVTOOLS_BASE_JS: + case IDR_DEVTOOLS_INJECT_DISPATCH_JS: return NetResourceProvider(resource_id); default: |