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

Side by Side Diff: content/shell/test_runner/test_runner.cc

Issue 2962073002: OOPIF support for layout test pixel dumps.
Patch Set: Rebasing on top of 8bc8e844008b (still works locally). Created 3 years, 5 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 unified diff | Download patch
OLDNEW
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 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" 46 #include "third_party/WebKit/public/platform/WebPasswordCredential.h"
47 #include "third_party/WebKit/public/platform/WebPoint.h" 47 #include "third_party/WebKit/public/platform/WebPoint.h"
48 #include "third_party/WebKit/public/platform/WebURLResponse.h" 48 #include "third_party/WebKit/public/platform/WebURLResponse.h"
49 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerRegistration.h" 49 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerRegistration.h"
50 #include "third_party/WebKit/public/web/WebArrayBuffer.h" 50 #include "third_party/WebKit/public/web/WebArrayBuffer.h"
51 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h" 51 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h"
52 #include "third_party/WebKit/public/web/WebDataSource.h" 52 #include "third_party/WebKit/public/web/WebDataSource.h"
53 #include "third_party/WebKit/public/web/WebDocument.h" 53 #include "third_party/WebKit/public/web/WebDocument.h"
54 #include "third_party/WebKit/public/web/WebFindOptions.h" 54 #include "third_party/WebKit/public/web/WebFindOptions.h"
55 #include "third_party/WebKit/public/web/WebFrame.h" 55 #include "third_party/WebKit/public/web/WebFrame.h"
56 #include "third_party/WebKit/public/web/WebFrameWidget.h"
56 #include "third_party/WebKit/public/web/WebInputElement.h" 57 #include "third_party/WebKit/public/web/WebInputElement.h"
57 #include "third_party/WebKit/public/web/WebKit.h" 58 #include "third_party/WebKit/public/web/WebKit.h"
58 #include "third_party/WebKit/public/web/WebLocalFrame.h" 59 #include "third_party/WebKit/public/web/WebLocalFrame.h"
59 #include "third_party/WebKit/public/web/WebPageImportanceSignals.h" 60 #include "third_party/WebKit/public/web/WebPageImportanceSignals.h"
60 #include "third_party/WebKit/public/web/WebScriptSource.h" 61 #include "third_party/WebKit/public/web/WebScriptSource.h"
61 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 62 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
62 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" 63 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
63 #include "third_party/WebKit/public/web/WebSettings.h" 64 #include "third_party/WebKit/public/web/WebSettings.h"
64 #include "third_party/WebKit/public/web/WebSurroundingText.h" 65 #include "third_party/WebKit/public/web/WebSurroundingText.h"
65 #include "third_party/WebKit/public/web/WebView.h" 66 #include "third_party/WebKit/public/web/WebView.h"
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 // See if we need to draw the selection bounds rect on top of the snapshot. 1789 // See if we need to draw the selection bounds rect on top of the snapshot.
1789 if (layout_test_runtime_flags_.dump_selection_rect()) { 1790 if (layout_test_runtime_flags_.dump_selection_rect()) {
1790 callback = 1791 callback =
1791 CreateSelectionBoundsRectDrawingCallback(frame, std::move(callback)); 1792 CreateSelectionBoundsRectDrawingCallback(frame, std::move(callback));
1792 } 1793 }
1793 1794
1794 // Request appropriate kind of pixel dump. 1795 // Request appropriate kind of pixel dump.
1795 if (layout_test_runtime_flags_.is_printing()) { 1796 if (layout_test_runtime_flags_.is_printing()) {
1796 test_runner::PrintFrameAsync(frame, std::move(callback)); 1797 test_runner::PrintFrameAsync(frame, std::move(callback));
1797 } else { 1798 } else {
1798 // TODO(lukasza): Ask the |delegate_| to capture the pixels in the browser 1799 if (frame->FrameWidget()->GetPagePopup()) {
1799 // process, so that OOPIF pixels are also captured. 1800 // TODO(lukasza): DO NOT SUBMIT: Can that also be handled by the browser
1800 test_runner::DumpPixelsAsync(frame, delegate_->GetDeviceScaleFactor(), 1801 // process?
1801 std::move(callback)); 1802 test_runner::DumpPixelsAsync(frame, delegate_->GetDeviceScaleFactor(),
1803 std::move(callback));
1804 } else {
1805 delegate_->DumpPixelsAsync(std::move(callback));
1806 }
1802 } 1807 }
1803 } 1808 }
1804 1809
1805 void TestRunner::ReplicateLayoutTestRuntimeFlagsChanges( 1810 void TestRunner::ReplicateLayoutTestRuntimeFlagsChanges(
1806 const base::DictionaryValue& changed_values) { 1811 const base::DictionaryValue& changed_values) {
1807 if (test_is_running_) { 1812 if (test_is_running_) {
1808 layout_test_runtime_flags_.tracked_dictionary().ApplyUntrackedChanges( 1813 layout_test_runtime_flags_.tracked_dictionary().ApplyUntrackedChanges(
1809 changed_values); 1814 changed_values);
1810 1815
1811 bool allowed = layout_test_runtime_flags_.plugins_allowed(); 1816 bool allowed = layout_test_runtime_flags_.plugins_allowed();
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
2848 2853
2849 void TestRunner::NotifyDone() { 2854 void TestRunner::NotifyDone() {
2850 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && 2855 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() &&
2851 !will_navigate_ && work_queue_.is_empty()) 2856 !will_navigate_ && work_queue_.is_empty())
2852 delegate_->TestFinished(); 2857 delegate_->TestFinished();
2853 layout_test_runtime_flags_.set_wait_until_done(false); 2858 layout_test_runtime_flags_.set_wait_until_done(false);
2854 OnLayoutTestRuntimeFlagsChanged(); 2859 OnLayoutTestRuntimeFlagsChanged();
2855 } 2860 }
2856 2861
2857 } // namespace test_runner 2862 } // namespace test_runner
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/layout_test_render_frame_observer.cc ('k') | content/shell/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698