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

Unified Diff: components/test_runner/web_test_proxy.cc

Issue 1889673002: Move LayoutAndPaintAsyncThen to a separate compilation unit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 4 years, 8 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
« no previous file with comments | « components/test_runner/web_test_proxy.h ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/web_test_proxy.cc
diff --git a/components/test_runner/web_test_proxy.cc b/components/test_runner/web_test_proxy.cc
index ed62aa30ddfe21ec598a49e1eaa6d9a37223faaa..013c696efa601031f04c8529d2657f1ae47cdfee 100644
--- a/components/test_runner/web_test_proxy.cc
+++ b/components/test_runner/web_test_proxy.cc
@@ -7,64 +7,16 @@
#include <stddef.h>
#include <stdint.h>
-#include <cctype>
-
-#include "base/callback_helpers.h"
-#include "base/command_line.h"
-#include "base/logging.h"
-#include "base/strings/string_util.h"
-#include "base/thread_task_runner_handle.h"
-#include "base/trace_event/trace_event.h"
-#include "components/test_runner/mock_credential_manager_client.h"
#include "components/test_runner/mock_screen_orientation_client.h"
-#include "components/test_runner/spell_check_client.h"
-#include "components/test_runner/test_common.h"
#include "components/test_runner/test_interfaces.h"
-#include "components/test_runner/test_plugin.h"
#include "components/test_runner/test_runner.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_interfaces.h"
-#include "components/test_runner/web_test_runner.h"
-#include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h"
-#include "third_party/WebKit/public/platform/WebURLError.h"
-#include "third_party/WebKit/public/platform/WebURLRequest.h"
-#include "third_party/WebKit/public/platform/WebURLResponse.h"
-#include "third_party/WebKit/public/web/WebAXEnums.h"
-#include "third_party/WebKit/public/web/WebAXObject.h"
-#include "third_party/WebKit/public/web/WebDocument.h"
-#include "third_party/WebKit/public/web/WebElement.h"
-#include "third_party/WebKit/public/web/WebHistoryItem.h"
-#include "third_party/WebKit/public/web/WebLocalFrame.h"
-#include "third_party/WebKit/public/web/WebNode.h"
-#include "third_party/WebKit/public/web/WebPagePopup.h"
-#include "third_party/WebKit/public/web/WebPluginParams.h"
-#include "third_party/WebKit/public/web/WebPrintParams.h"
-#include "third_party/WebKit/public/web/WebRange.h"
-#include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
-#include "third_party/WebKit/public/web/WebView.h"
namespace test_runner {
namespace {
-class LayoutAndPaintCallback : public blink::WebLayoutAndPaintAsyncCallback {
- public:
- LayoutAndPaintCallback(const base::Closure& callback)
- : callback_(callback), wait_for_popup_(false) {
- }
- virtual ~LayoutAndPaintCallback() {
- }
-
- void set_wait_for_popup(bool wait) { wait_for_popup_ = wait; }
-
- // WebLayoutAndPaintAsyncCallback implementation.
- void didLayoutAndPaint() override;
-
- private:
- base::Closure callback_;
- bool wait_for_popup_;
-};
-
std::string DumpAllBackForwardLists(TestInterfaces* interfaces,
WebTestDelegate* delegate) {
std::string result;
@@ -96,30 +48,6 @@ std::string WebTestProxyBase::DumpBackForwardLists() {
return DumpAllBackForwardLists(test_interfaces_, delegate_);
}
-void LayoutAndPaintCallback::didLayoutAndPaint() {
- TRACE_EVENT0("shell", "LayoutAndPaintCallback::didLayoutAndPaint");
- if (wait_for_popup_) {
- wait_for_popup_ = false;
- return;
- }
-
- if (!callback_.is_null())
- callback_.Run();
- delete this;
-}
-
-void WebTestProxyBase::LayoutAndPaintAsyncThen(const base::Closure& callback) {
- TRACE_EVENT0("shell", "WebTestProxyBase::LayoutAndPaintAsyncThen");
-
- LayoutAndPaintCallback* layout_and_paint_callback =
- new LayoutAndPaintCallback(callback);
- web_widget_->layoutAndPaintAsync(layout_and_paint_callback);
- if (blink::WebPagePopup* popup = web_widget_->pagePopup()) {
- layout_and_paint_callback->set_wait_for_popup(true);
- popup->layoutAndPaintAsync(layout_and_paint_callback);
- }
-}
-
void WebTestProxyBase::GetScreenOrientationForTesting(
blink::WebScreenInfo& screen_info) {
MockScreenOrientationClient* mock_client =
« no previous file with comments | « components/test_runner/web_test_proxy.h ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698