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

Unified Diff: components/test_runner/test_runner.cc

Issue 1807733002: Make MockScreenOrientationClient an internal detail of components/test_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-app-banner-dep
Patch Set: Rebasing... Created 4 years, 9 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
Index: components/test_runner/test_runner.cc
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
index acc03f7772f10f3869c49953ff94a9ec858fb74f..571ffb0f8d1351077e3e80c0c83d69e6640f7360 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -16,6 +16,7 @@
#include "build/build_config.h"
#include "components/test_runner/app_banner_client.h"
#include "components/test_runner/mock_credential_manager_client.h"
+#include "components/test_runner/mock_screen_orientation_client.h"
#include "components/test_runner/mock_web_speech_recognizer.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/test_preferences.h"
@@ -1663,6 +1664,7 @@ TestRunner::TestRunner(TestInterfaces* interfaces)
delegate_(nullptr),
web_view_(nullptr),
web_content_settings_(new WebContentSettings()),
+ mock_screen_orientation_client_(new MockScreenOrientationClient),
weak_factory_(this) {}
TestRunner::~TestRunner() {}
@@ -1700,6 +1702,7 @@ void TestRunner::Reset() {
top_loading_frame_ = nullptr;
layout_dump_flags_.Reset();
+ mock_screen_orientation_client_->ResetData();
Łukasz Anforowicz 2016/03/16 00:16:01 This just copies method body from the deleted Blin
wait_until_external_url_load_ = false;
policy_delegate_enabled_ = false;
policy_delegate_is_permissive_ = false;
@@ -1720,7 +1723,6 @@ void TestRunner::Reset() {
delegate_->UseUnfortunateSynchronousResizeMode(false);
delegate_->DisableAutoResizeMode(WebSize());
delegate_->DeleteAllCookies();
- delegate_->ResetScreenOrientation();
delegate_->SetBluetoothMockDataSet("");
delegate_->ClearGeofencingMockProvider();
delegate_->ResetPermissions();
@@ -2500,6 +2502,10 @@ void TestRunner::SetMockDeviceOrientation(bool has_alpha, double alpha,
delegate_->SetDeviceOrientationData(orientation);
}
+MockScreenOrientationClient* TestRunner::getMockScreenOrientationClient() {
+ return mock_screen_orientation_client_.get();
+}
+
void TestRunner::SetMockScreenOrientation(const std::string& orientation_str) {
blink::WebScreenOrientationType orientation;
@@ -2509,15 +2515,19 @@ void TestRunner::SetMockScreenOrientation(const std::string& orientation_str) {
orientation = WebScreenOrientationPortraitSecondary;
} else if (orientation_str == "landscape-primary") {
orientation = WebScreenOrientationLandscapePrimary;
- } else if (orientation_str == "landscape-secondary") {
+ } else {
+ DCHECK_EQ("landscape-secondary", orientation_str);
Łukasz Anforowicz 2016/03/16 00:16:00 Otherwise |orientation| might not be initialized a
orientation = WebScreenOrientationLandscapeSecondary;
}
- delegate_->SetScreenOrientation(orientation);
+ // TODO(lukasza): This is broken for OOPIFs.
+ WebLocalFrame* main_frame = web_view_->mainFrame()->toWebLocalFrame();
+ mock_screen_orientation_client_->UpdateDeviceOrientation(
+ main_frame, orientation);
Łukasz Anforowicz 2016/03/16 00:16:00 This just copies method body from the deleted Blin
}
void TestRunner::DisableMockScreenOrientation() {
- delegate_->DisableMockScreenOrientation();
+ mock_screen_orientation_client_->SetDisabled(true);
Łukasz Anforowicz 2016/03/16 00:16:01 This just copies method body from the deleted Blin
}
void TestRunner::DidAcquirePointerLock() {

Powered by Google App Engine
This is Rietveld 408576698