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 "components/test_runner/test_runner.h" | 5 #include "components/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 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1856 } | 1856 } |
1857 | 1857 |
1858 bool TestRunner::ShouldDumpAsAudio() const { | 1858 bool TestRunner::ShouldDumpAsAudio() const { |
1859 return dump_as_audio_; | 1859 return dump_as_audio_; |
1860 } | 1860 } |
1861 | 1861 |
1862 void TestRunner::GetAudioData(std::vector<unsigned char>* buffer_view) const { | 1862 void TestRunner::GetAudioData(std::vector<unsigned char>* buffer_view) const { |
1863 *buffer_view = audio_data_; | 1863 *buffer_view = audio_data_; |
1864 } | 1864 } |
1865 | 1865 |
| 1866 LayoutDumpFlags TestRunner::GetLayoutDumpFlags() { |
| 1867 LayoutDumpFlags result; |
| 1868 |
| 1869 if (shouldDumpAsText()) { |
| 1870 result.main_dump_mode = LayoutDumpMode::DUMP_AS_TEXT; |
| 1871 result.dump_child_frames = shouldDumpChildFramesAsText(); |
| 1872 } else if (shouldDumpAsMarkup()) { |
| 1873 result.main_dump_mode = LayoutDumpMode::DUMP_AS_MARKUP; |
| 1874 result.dump_child_frames = shouldDumpChildFramesAsMarkup(); |
| 1875 } else { |
| 1876 result.main_dump_mode = LayoutDumpMode::DUMP_SCROLL_POSITIONS; |
| 1877 result.dump_child_frames = shouldDumpChildFrameScrollPositions(); |
| 1878 } |
| 1879 |
| 1880 result.dump_as_printed = isPrinting(); |
| 1881 |
| 1882 result.dump_line_box_trees = result.debug_render_tree = false; |
| 1883 |
| 1884 return result; |
| 1885 } |
| 1886 |
| 1887 bool TestRunner::HasCustomTextDump(std::string* custom_text_dump) const { |
| 1888 if (shouldDumpAsCustomText()) { |
| 1889 *custom_text_dump = customDumpText(); |
| 1890 return true; |
| 1891 } |
| 1892 |
| 1893 return false; |
| 1894 } |
| 1895 |
1866 bool TestRunner::shouldDumpFrameLoadCallbacks() const { | 1896 bool TestRunner::shouldDumpFrameLoadCallbacks() const { |
1867 return test_is_running_ && dump_frame_load_callbacks_; | 1897 return test_is_running_ && dump_frame_load_callbacks_; |
1868 } | 1898 } |
1869 | 1899 |
1870 void TestRunner::setShouldDumpFrameLoadCallbacks(bool value) { | 1900 void TestRunner::setShouldDumpFrameLoadCallbacks(bool value) { |
1871 dump_frame_load_callbacks_ = value; | 1901 dump_frame_load_callbacks_ = value; |
1872 } | 1902 } |
1873 | 1903 |
1874 bool TestRunner::shouldDumpPingLoaderCallbacks() const { | 1904 bool TestRunner::shouldDumpPingLoaderCallbacks() const { |
1875 return test_is_running_ && dump_ping_loader_callbacks_; | 1905 return test_is_running_ && dump_ping_loader_callbacks_; |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3188 } | 3218 } |
3189 | 3219 |
3190 void TestRunner::DidLosePointerLockInternal() { | 3220 void TestRunner::DidLosePointerLockInternal() { |
3191 bool was_locked = pointer_locked_; | 3221 bool was_locked = pointer_locked_; |
3192 pointer_locked_ = false; | 3222 pointer_locked_ = false; |
3193 if (was_locked) | 3223 if (was_locked) |
3194 web_view_->didLosePointerLock(); | 3224 web_view_->didLosePointerLock(); |
3195 } | 3225 } |
3196 | 3226 |
3197 } // namespace test_runner | 3227 } // namespace test_runner |
OLD | NEW |