Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1421)

Unified Diff: content/shell/renderer/test_runner/test_runner.cc

Issue 916893003: Add test_runner hook to dump drag image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check flag instead of drag_image_. Handle isNull case. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/test_runner/test_runner.cc
diff --git a/content/shell/renderer/test_runner/test_runner.cc b/content/shell/renderer/test_runner/test_runner.cc
index 7bf164bbfbb5dbf71db4a03aa041a4f82b4e3cc7..2b79535bcefc506a7094f634a0ebe439c13a6f1f 100644
--- a/content/shell/renderer/test_runner/test_runner.cc
+++ b/content/shell/renderer/test_runner/test_runner.cc
@@ -255,6 +255,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void DumpResourceRequestPriorities();
void SetUseMockTheme(bool use);
void WaitUntilExternalURLLoad();
+ void DumpDragImage();
void ShowWebInspector(gin::Arguments* args);
void CloseWebInspector();
bool IsChooserShown();
@@ -493,6 +494,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
.SetMethod("setUseMockTheme", &TestRunnerBindings::SetUseMockTheme)
.SetMethod("waitUntilExternalURLLoad",
&TestRunnerBindings::WaitUntilExternalURLLoad)
+ .SetMethod("dumpDragImage", &TestRunnerBindings::DumpDragImage)
.SetMethod("showWebInspector", &TestRunnerBindings::ShowWebInspector)
.SetMethod("closeWebInspector", &TestRunnerBindings::CloseWebInspector)
.SetMethod("isChooserShown", &TestRunnerBindings::IsChooserShown)
@@ -1225,6 +1227,11 @@ void TestRunnerBindings::WaitUntilExternalURLLoad() {
runner_->WaitUntilExternalURLLoad();
}
+void TestRunnerBindings::DumpDragImage() {
+ if (runner_)
+ runner_->DumpDragImage();
+}
+
void TestRunnerBindings::ShowWebInspector(gin::Arguments* args) {
if (runner_) {
std::string settings;
@@ -1659,6 +1666,7 @@ void TestRunner::Reset() {
dump_spell_check_callbacks_ = false;
dump_back_forward_list_ = false;
dump_selection_rect_ = false;
+ dump_drag_image_ = false;
test_repaint_ = false;
sweep_horizontally_ = false;
is_printing_ = false;
@@ -1929,6 +1937,10 @@ void TestRunner::setToolTipText(const WebString& text) {
tooltip_text_ = text.utf8();
}
+bool TestRunner::shouldDumpDragImage() {
+ return dump_drag_image_;
+}
+
bool TestRunner::midiAccessorResult() {
return midi_accessor_result_;
}
@@ -2725,6 +2737,11 @@ void TestRunner::WaitUntilExternalURLLoad() {
wait_until_external_url_load_ = true;
}
+void TestRunner::DumpDragImage() {
+ DumpAsTextWithPixelResults();
+ dump_drag_image_ = true;
+}
+
void TestRunner::CloseWebInspector() {
delegate_->CloseDevTools();
}
« no previous file with comments | « content/shell/renderer/test_runner/test_runner.h ('k') | content/shell/renderer/test_runner/web_test_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698