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 dca6cdd06021eab6afdecef15679a0961e9b237a..6d3bbe26f0f8ed694a80b2cdb9c1b53c6ffc2ca1 100644 |
--- a/content/shell/renderer/test_runner/test_runner.cc |
+++ b/content/shell/renderer/test_runner/test_runner.cc |
@@ -187,9 +187,11 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
void SetAcceptLanguages(const std::string& accept_languages); |
void SetPluginsEnabled(bool enabled); |
void DumpEditingCallbacks(); |
+ void DumpAsMarkup(); |
void DumpAsText(); |
void DumpAsTextWithPixelResults(); |
void DumpChildFrameScrollPositions(); |
+ void DumpChildFramesAsMarkup(); |
void DumpChildFramesAsText(); |
void DumpIconChanges(); |
void SetAudioData(const gin::ArrayBufferView& view); |
@@ -247,6 +249,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
void DisplayAsync(); |
void DisplayAsyncThen(v8::Handle<v8::Function> callback); |
void SetCustomTextOutput(std::string output); |
+ void SetViewSourceForFrame(const std::string& name, bool enabled); |
bool GlobalFlag(); |
void SetGlobalFlag(bool value); |
@@ -388,6 +391,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
.SetMethod("setPluginsEnabled", &TestRunnerBindings::SetPluginsEnabled) |
.SetMethod("dumpEditingCallbacks", |
&TestRunnerBindings::DumpEditingCallbacks) |
+ .SetMethod("dumpAsMarkup", &TestRunnerBindings::DumpAsMarkup) |
.SetMethod("dumpAsText", &TestRunnerBindings::DumpAsText) |
.SetMethod("dumpAsTextWithPixelResults", |
&TestRunnerBindings::DumpAsTextWithPixelResults) |
@@ -395,6 +399,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
&TestRunnerBindings::DumpChildFrameScrollPositions) |
.SetMethod("dumpChildFramesAsText", |
&TestRunnerBindings::DumpChildFramesAsText) |
+ .SetMethod("dumpChildFramesAsMarkup", |
+ &TestRunnerBindings::DumpChildFramesAsMarkup) |
.SetMethod("dumpIconChanges", &TestRunnerBindings::DumpIconChanges) |
.SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) |
.SetMethod("dumpFrameLoadCallbacks", |
@@ -480,6 +486,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
.SetMethod("displayAsyncThen", &TestRunnerBindings::DisplayAsyncThen) |
.SetMethod("setCustomTextOutput", |
&TestRunnerBindings::SetCustomTextOutput) |
+ .SetMethod("setViewSourceForFrame", |
+ &TestRunnerBindings::SetViewSourceForFrame) |
// Properties. |
.SetProperty("globalFlag", |
@@ -940,6 +948,11 @@ void TestRunnerBindings::DumpEditingCallbacks() { |
runner_->DumpEditingCallbacks(); |
} |
+void TestRunnerBindings::DumpAsMarkup() { |
+ if (runner_) |
+ runner_->DumpAsMarkup(); |
+} |
+ |
void TestRunnerBindings::DumpAsText() { |
if (runner_) |
runner_->DumpAsText(); |
@@ -960,6 +973,11 @@ void TestRunnerBindings::DumpChildFramesAsText() { |
runner_->DumpChildFramesAsText(); |
} |
+void TestRunnerBindings::DumpChildFramesAsMarkup() { |
+ if (runner_) |
+ runner_->DumpChildFramesAsMarkup(); |
+} |
+ |
void TestRunnerBindings::DumpIconChanges() { |
if (runner_) |
runner_->DumpIconChanges(); |
@@ -1246,6 +1264,16 @@ void TestRunnerBindings::SetCustomTextOutput(std::string output) { |
runner_->setCustomTextOutput(output); |
} |
+void TestRunnerBindings::SetViewSourceForFrame(const std::string& name, |
+ bool enabled) { |
+ if (runner_ && runner_->web_view_) { |
+ WebFrame* target_frame = |
+ runner_->web_view_->findFrameByName(WebString::fromUTF8(name)); |
+ if (target_frame) |
+ target_frame->enableViewSourceMode(enabled); |
+ } |
+} |
+ |
bool TestRunnerBindings::GlobalFlag() { |
if (runner_) |
return runner_->global_flag_; |
@@ -1454,6 +1482,7 @@ void TestRunner::Reset() { |
dump_as_markup_ = false; |
generate_pixel_results_ = true; |
dump_child_frame_scroll_positions_ = false; |
+ dump_child_frames_as_markup_ = false; |
dump_child_frames_as_text_ = false; |
dump_icon_changes_ = false; |
dump_as_audio_ = false; |
@@ -1560,6 +1589,10 @@ bool TestRunner::shouldDumpChildFrameScrollPositions() const { |
return dump_child_frame_scroll_positions_; |
} |
+bool TestRunner::shouldDumpChildFramesAsMarkup() const { |
+ return dump_child_frames_as_markup_; |
+} |
+ |
bool TestRunner::shouldDumpChildFramesAsText() const { |
return dump_child_frames_as_text_; |
} |
@@ -2345,6 +2378,11 @@ void TestRunner::DumpEditingCallbacks() { |
dump_editting_callbacks_ = true; |
} |
+void TestRunner::DumpAsMarkup() { |
+ dump_as_markup_ = true; |
+ generate_pixel_results_ = false; |
+} |
+ |
void TestRunner::DumpAsText() { |
dump_as_text_ = true; |
generate_pixel_results_ = false; |
@@ -2359,6 +2397,10 @@ void TestRunner::DumpChildFrameScrollPositions() { |
dump_child_frame_scroll_positions_ = true; |
} |
+void TestRunner::DumpChildFramesAsMarkup() { |
+ dump_child_frames_as_markup_ = true; |
+} |
+ |
void TestRunner::DumpChildFramesAsText() { |
dump_child_frames_as_text_ = true; |
} |