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

Side by Side Diff: headless/lib/headless_devtools_client_browsertest.cc

Issue 2905043003: [headless] Fix window management browsertests on Mac. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 browser_devtools_client_->GetBrowser()->GetExperimental()->GetWindowBounds( 140 browser_devtools_client_->GetBrowser()->GetExperimental()->GetWindowBounds(
141 std::move(params), callback); 141 std::move(params), callback);
142 } 142 }
143 143
144 void CheckWindowBounds( 144 void CheckWindowBounds(
145 const gfx::Rect& bounds, 145 const gfx::Rect& bounds,
146 const browser::WindowState state, 146 const browser::WindowState state,
147 std::unique_ptr<browser::GetWindowBoundsResult> result) { 147 std::unique_ptr<browser::GetWindowBoundsResult> result) {
148 const headless::browser::Bounds* actual_bounds = result->GetBounds(); 148 const headless::browser::Bounds* actual_bounds = result->GetBounds();
149 // https://crbug.com/726288: Mac does not currently support repositioning.
150 #if !defined(OS_MACOSX)
149 EXPECT_EQ(bounds.x(), actual_bounds->GetLeft()); 151 EXPECT_EQ(bounds.x(), actual_bounds->GetLeft());
150 EXPECT_EQ(bounds.y(), actual_bounds->GetTop()); 152 EXPECT_EQ(bounds.y(), actual_bounds->GetTop());
153 #endif // !defined(OS_MACOSX)
151 EXPECT_EQ(bounds.width(), actual_bounds->GetWidth()); 154 EXPECT_EQ(bounds.width(), actual_bounds->GetWidth());
152 EXPECT_EQ(bounds.height(), actual_bounds->GetHeight()); 155 EXPECT_EQ(bounds.height(), actual_bounds->GetHeight());
153 EXPECT_EQ(state, actual_bounds->GetWindowState()); 156 EXPECT_EQ(state, actual_bounds->GetWindowState());
154 } 157 }
155 }; 158 };
156 159
157 class HeadlessDevToolsClientChangeWindowBoundsTest 160 class HeadlessDevToolsClientChangeWindowBoundsTest
158 : public HeadlessDevToolsClientWindowManagementTest { 161 : public HeadlessDevToolsClientWindowManagementTest {
159 void RunDevTooledTest() override { 162 void RunDevTooledTest() override {
160 SetWindowBounds( 163 SetWindowBounds(
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 } 1199 }
1197 1200
1198 private: 1201 private:
1199 bool dev_tools_client_attached_ = false; 1202 bool dev_tools_client_attached_ = false;
1200 bool dev_tools_client_detached_ = false; 1203 bool dev_tools_client_detached_ = false;
1201 }; 1204 };
1202 1205
1203 HEADLESS_ASYNC_DEVTOOLED_TEST_F(DevToolsAttachAndDetachNotifications); 1206 HEADLESS_ASYNC_DEVTOOLED_TEST_F(DevToolsAttachAndDetachNotifications);
1204 1207
1205 } // namespace headless 1208 } // namespace headless
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698