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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc

Issue 138903007: Fixes _NET_ACTIVE_WINDOW support check in order to not always return no. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aura_deactivate
Patch Set: fix views_unittests Created 6 years, 11 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 | ui/views/widget/desktop_aura/x11_desktop_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/views/widget/desktop_aura/desktop_screen_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/display_observer.h" 9 #include "ui/gfx/display_observer.h"
10 #include "ui/views/test/views_test_base.h" 10 #include "ui/views/test/views_test_base.h"
11 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" 11 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
12 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" 12 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h"
13 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
13 14
14 namespace views { 15 namespace views {
15 16
16 const int64 kFirstDisplay = 5321829; 17 const int64 kFirstDisplay = 5321829;
17 const int64 kSecondDisplay = 928310; 18 const int64 kSecondDisplay = 928310;
18 19
19 class DesktopScreenX11Test : public views::ViewsTestBase, 20 class DesktopScreenX11Test : public views::ViewsTestBase,
20 public gfx::DisplayObserver { 21 public gfx::DisplayObserver {
21 public: 22 public:
22 DesktopScreenX11Test() {} 23 DesktopScreenX11Test() {}
23 virtual ~DesktopScreenX11Test() {} 24 virtual ~DesktopScreenX11Test() {}
24 25
25 // Overridden from testing::Test: 26 // Overridden from testing::Test:
26 virtual void SetUp() OVERRIDE { 27 virtual void SetUp() OVERRIDE {
27 ViewsTestBase::SetUp(); 28 ViewsTestBase::SetUp();
28 // Initialize the world to the single monitor case. 29 // Initialize the world to the single monitor case.
29 std::vector<gfx::Display> displays; 30 std::vector<gfx::Display> displays;
30 displays.push_back(gfx::Display(kFirstDisplay, gfx::Rect(0, 0, 640, 480))); 31 displays.push_back(gfx::Display(kFirstDisplay, gfx::Rect(0, 0, 640, 480)));
31 screen_.reset(new DesktopScreenX11(displays)); 32 screen_.reset(new DesktopScreenX11(displays));
32 screen_->AddObserver(this); 33 screen_->AddObserver(this);
34
35 // We want to have a synchronous activation behavior.
36 X11DesktopHandler::get()->SetWMSupportsActiveWindowForTests(false);
33 } 37 }
34 38
35 virtual void TearDown() OVERRIDE { 39 virtual void TearDown() OVERRIDE {
36 screen_.reset(); 40 screen_.reset();
37 ViewsTestBase::TearDown(); 41 ViewsTestBase::TearDown();
38 } 42 }
39 43
40 protected: 44 protected:
41 std::vector<gfx::Display> changed_display_; 45 std::vector<gfx::Display> changed_display_;
42 std::vector<gfx::Display> added_display_; 46 std::vector<gfx::Display> added_display_;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 screen()->GetDisplayNearestWindow(window_one->GetNativeWindow()).id()); 251 screen()->GetDisplayNearestWindow(window_one->GetNativeWindow()).id());
248 EXPECT_EQ( 252 EXPECT_EQ(
249 kSecondDisplay, 253 kSecondDisplay,
250 screen()->GetDisplayNearestWindow(window_two->GetNativeWindow()).id()); 254 screen()->GetDisplayNearestWindow(window_two->GetNativeWindow()).id());
251 255
252 window_one->CloseNow(); 256 window_one->CloseNow();
253 window_two->CloseNow(); 257 window_two->CloseNow();
254 } 258 }
255 259
256 } // namespace views 260 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/x11_desktop_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698