| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/browser/webkit_test_controller.h" | 5 #include "content/shell/browser/webkit_test_controller.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "content/public/browser/devtools_agent_host.h" | 15 #include "content/public/browser/devtools_agent_host.h" |
| 16 #include "content/public/browser/dom_storage_context.h" | 16 #include "content/public/browser/dom_storage_context.h" |
| 17 #include "content/public/browser/gpu_data_manager.h" | 17 #include "content/public/browser/gpu_data_manager.h" |
| 18 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
| 19 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 20 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
| 21 #include "content/public/browser/notification_types.h" | 21 #include "content/public/browser/notification_types.h" |
| 22 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 23 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
| 24 #include "content/public/browser/render_widget_host_view.h" | 24 #include "content/public/browser/render_widget_host_view.h" |
| 25 #include "content/public/browser/storage_partition.h" | 25 #include "content/public/browser/storage_partition.h" |
| 26 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
| 27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/common/url_constants.h" | 28 #include "content/public/common/url_constants.h" |
| 29 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
| 29 #include "content/shell/browser/shell.h" | 30 #include "content/shell/browser/shell.h" |
| 30 #include "content/shell/browser/shell_browser_context.h" | 31 #include "content/shell/browser/shell_browser_context.h" |
| 31 #include "content/shell/browser/shell_content_browser_client.h" | 32 #include "content/shell/browser/shell_content_browser_client.h" |
| 32 #include "content/shell/browser/shell_devtools_frontend.h" | 33 #include "content/shell/browser/shell_devtools_frontend.h" |
| 33 #include "content/shell/common/shell_messages.h" | 34 #include "content/shell/common/shell_messages.h" |
| 34 #include "content/shell/common/shell_switches.h" | 35 #include "content/shell/common/shell_switches.h" |
| 35 #include "content/shell/common/webkit_test_helpers.h" | 36 #include "content/shell/common/webkit_test_helpers.h" |
| 36 #include "ui/gfx/codec/png_codec.h" | 37 #include "ui/gfx/codec/png_codec.h" |
| 37 | 38 |
| 38 namespace content { | 39 namespace content { |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 should_override_prefs_ = true; | 577 should_override_prefs_ = true; |
| 577 prefs_ = prefs; | 578 prefs_ = prefs; |
| 578 } | 579 } |
| 579 | 580 |
| 580 void WebKitTestController::OnClearDevToolsLocalStorage() { | 581 void WebKitTestController::OnClearDevToolsLocalStorage() { |
| 581 ShellBrowserContext* browser_context = | 582 ShellBrowserContext* browser_context = |
| 582 ShellContentBrowserClient::Get()->browser_context(); | 583 ShellContentBrowserClient::Get()->browser_context(); |
| 583 StoragePartition* storage_partition = | 584 StoragePartition* storage_partition = |
| 584 BrowserContext::GetStoragePartition(browser_context, NULL); | 585 BrowserContext::GetStoragePartition(browser_context, NULL); |
| 585 storage_partition->GetDOMStorageContext()->DeleteLocalStorage( | 586 storage_partition->GetDOMStorageContext()->DeleteLocalStorage( |
| 586 content::GetDevToolsPathAsURL("", "").GetOrigin()); | 587 content::LayoutTestDevToolsFrontend::GetDevToolsPathAsURL("", "") |
| 588 .GetOrigin()); |
| 587 } | 589 } |
| 588 | 590 |
| 589 void WebKitTestController::OnShowDevTools(const std::string& settings, | 591 void WebKitTestController::OnShowDevTools(const std::string& settings, |
| 590 const std::string& frontend_url) { | 592 const std::string& frontend_url) { |
| 591 main_window_->ShowDevToolsForTest(settings, frontend_url); | 593 main_window_->ShowDevToolsForTest(settings, frontend_url); |
| 592 } | 594 } |
| 593 | 595 |
| 594 void WebKitTestController::OnCloseDevTools() { | 596 void WebKitTestController::OnCloseDevTools() { |
| 595 main_window_->CloseDevTools(); | 597 main_window_->CloseDevTools(); |
| 596 } | 598 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 | 689 |
| 688 printer_->AddErrorMessage( | 690 printer_->AddErrorMessage( |
| 689 base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_, | 691 base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_, |
| 690 result.detail.c_str())); | 692 result.detail.c_str())); |
| 691 CHECK(!crash_when_leak_found_); | 693 CHECK(!crash_when_leak_found_); |
| 692 | 694 |
| 693 DiscardMainWindow(); | 695 DiscardMainWindow(); |
| 694 } | 696 } |
| 695 | 697 |
| 696 } // namespace content | 698 } // namespace content |
| OLD | NEW |