WebKitTestController::WebKitTestController()
: main_window_(NULL),
- test_phase_(BETWEEN_TESTS) {
+ test_phase_(BETWEEN_TESTS),
+ is_leak_detection_enabled_(CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableLeakDetection)) {
CHECK(!instance_);
instance_ = this;
printer_.reset(new WebKitTestResultPrinter(&std::cout, &std::cerr));
DiscardMainWindow();
}
-void WebKitTestController::TimeoutHandler() {
- DCHECK(CalledOnValidThread());
- printer_->AddErrorMessage(
- "FAIL: Timed out waiting for notifyDone to be called");
- DiscardMainWindow();
-}
-
void WebKitTestController::DiscardMainWindow() {
// If we're running a test, we need to close all windows and exit the message
// loop. Otherwise, we're already outside of the message loop, and we just
StoragePartition* storage_partition =
BrowserContext::GetStoragePartition(browser_context, NULL);
storage_partition->GetDOMStorageContext()->DeleteLocalStorage(
- content::GetDevToolsPathAsURL().GetOrigin());
+ content::GetDevToolsPathAsURL("").GetOrigin());
}
-void WebKitTestController::OnShowDevTools() {
- main_window_->ShowDevTools();
+void WebKitTestController::OnShowDevTools(const std::string& settings) {
+ main_window_->ShowDevToolsForTest(settings);
}
void WebKitTestController::OnCloseDevTools() {
}
void WebKitTestController::OnResetDone() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableLeakDetection)) {
+ if (is_leak_detection_enabled_) {
if (main_window_ && main_window_->web_contents()) {
RenderViewHost* render_view_host =
main_window_->web_contents()->GetRenderViewHost();
return;
}
- printer_->AddErrorMessage("#LEAK");
- printer_->AddErrorMessage(
- base::StringPrintf(" Number of live documents: %d",
- result.number_of_live_documents));
printer_->AddErrorMessage(
- base::StringPrintf(" Number of live nodes: %d",
- result.number_of_live_nodes));
+ base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_,
+ result.detail.c_str()));
DiscardMainWindow();
}