| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |