OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/test_runner/test_runner.h" | 5 #include "content/shell/test_runner/test_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 | 2551 |
2552 void TestRunner::DumpPermissionClientCallbacks() { | 2552 void TestRunner::DumpPermissionClientCallbacks() { |
2553 layout_test_runtime_flags_.set_dump_web_content_settings_client_callbacks( | 2553 layout_test_runtime_flags_.set_dump_web_content_settings_client_callbacks( |
2554 true); | 2554 true); |
2555 OnLayoutTestRuntimeFlagsChanged(); | 2555 OnLayoutTestRuntimeFlagsChanged(); |
2556 } | 2556 } |
2557 | 2557 |
2558 void TestRunner::SetDisallowedSubresourcePathSuffixes( | 2558 void TestRunner::SetDisallowedSubresourcePathSuffixes( |
2559 const std::vector<std::string>& suffixes) { | 2559 const std::vector<std::string>& suffixes) { |
2560 DCHECK(main_view_); | 2560 DCHECK(main_view_); |
2561 main_view_->MainFrame()->DataSource()->SetSubresourceFilter( | 2561 if (!main_view_->MainFrame()->IsWebLocalFrame()) |
2562 new MockWebDocumentSubresourceFilter(suffixes)); | 2562 return; |
| 2563 main_view_->MainFrame() |
| 2564 ->ToWebLocalFrame() |
| 2565 ->DataSource() |
| 2566 ->SetSubresourceFilter(new MockWebDocumentSubresourceFilter(suffixes)); |
2563 } | 2567 } |
2564 | 2568 |
2565 void TestRunner::DumpSpellCheckCallbacks() { | 2569 void TestRunner::DumpSpellCheckCallbacks() { |
2566 layout_test_runtime_flags_.set_dump_spell_check_callbacks(true); | 2570 layout_test_runtime_flags_.set_dump_spell_check_callbacks(true); |
2567 OnLayoutTestRuntimeFlagsChanged(); | 2571 OnLayoutTestRuntimeFlagsChanged(); |
2568 } | 2572 } |
2569 | 2573 |
2570 void TestRunner::DumpBackForwardList() { | 2574 void TestRunner::DumpBackForwardList() { |
2571 dump_back_forward_list_ = true; | 2575 dump_back_forward_list_ = true; |
2572 } | 2576 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2784 void TestRunner::CheckResponseMimeType() { | 2788 void TestRunner::CheckResponseMimeType() { |
2785 // Text output: the test page can request different types of output which we | 2789 // Text output: the test page can request different types of output which we |
2786 // handle here. | 2790 // handle here. |
2787 | 2791 |
2788 if (layout_test_runtime_flags_.dump_as_text()) | 2792 if (layout_test_runtime_flags_.dump_as_text()) |
2789 return; | 2793 return; |
2790 | 2794 |
2791 if (!main_view_) | 2795 if (!main_view_) |
2792 return; | 2796 return; |
2793 | 2797 |
2794 WebDataSource* data_source = main_view_->MainFrame()->DataSource(); | 2798 if (!main_view_->MainFrame()->IsWebLocalFrame()) |
| 2799 return; |
| 2800 |
| 2801 WebDataSource* data_source = |
| 2802 main_view_->MainFrame()->ToWebLocalFrame()->DataSource(); |
2795 if (!data_source) | 2803 if (!data_source) |
2796 return; | 2804 return; |
2797 | 2805 |
2798 std::string mimeType = data_source->GetResponse().MimeType().Utf8(); | 2806 std::string mimeType = data_source->GetResponse().MimeType().Utf8(); |
2799 if (mimeType != "text/plain") | 2807 if (mimeType != "text/plain") |
2800 return; | 2808 return; |
2801 | 2809 |
2802 layout_test_runtime_flags_.set_dump_as_text(true); | 2810 layout_test_runtime_flags_.set_dump_as_text(true); |
2803 layout_test_runtime_flags_.set_generate_pixel_results(false); | 2811 layout_test_runtime_flags_.set_generate_pixel_results(false); |
2804 OnLayoutTestRuntimeFlagsChanged(); | 2812 OnLayoutTestRuntimeFlagsChanged(); |
2805 } | 2813 } |
2806 | 2814 |
2807 void TestRunner::NotifyDone() { | 2815 void TestRunner::NotifyDone() { |
2808 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2816 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
2809 !will_navigate_ && work_queue_.is_empty()) | 2817 !will_navigate_ && work_queue_.is_empty()) |
2810 delegate_->TestFinished(); | 2818 delegate_->TestFinished(); |
2811 layout_test_runtime_flags_.set_wait_until_done(false); | 2819 layout_test_runtime_flags_.set_wait_until_done(false); |
2812 OnLayoutTestRuntimeFlagsChanged(); | 2820 OnLayoutTestRuntimeFlagsChanged(); |
2813 } | 2821 } |
2814 | 2822 |
2815 } // namespace test_runner | 2823 } // namespace test_runner |
OLD | NEW |