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

Side by Side Diff: ui/wm/core/transient_window_manager_unittest.cc

Issue 1050713002: aura: Remove layerless windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layerless: rebase Created 5 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 unified diff | Download patch
« no previous file with comments | « ui/wm/core/shadow_controller_unittest.cc ('k') | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/wm/core/transient_window_manager.h" 5 #include "ui/wm/core/transient_window_manager.h"
6 6
7 #include "ui/aura/client/window_tree_client.h" 7 #include "ui/aura/client/window_tree_client.h"
8 #include "ui/aura/test/aura_test_base.h" 8 #include "ui/aura/test/aura_test_base.h"
9 #include "ui/aura/test/test_windows.h" 9 #include "ui/aura/test/test_windows.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 wm_state_.reset(); 58 wm_state_.reset();
59 AuraTestBase::TearDown(); 59 AuraTestBase::TearDown();
60 } 60 }
61 61
62 protected: 62 protected:
63 // Creates a transient window that is transient to |parent|. 63 // Creates a transient window that is transient to |parent|.
64 Window* CreateTransientChild(int id, Window* parent) { 64 Window* CreateTransientChild(int id, Window* parent) {
65 Window* window = new Window(NULL); 65 Window* window = new Window(NULL);
66 window->set_id(id); 66 window->set_id(id);
67 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); 67 window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
68 window->Init(aura::WINDOW_LAYER_TEXTURED); 68 window->Init(ui::LAYER_TEXTURED);
69 AddTransientChild(parent, window); 69 AddTransientChild(parent, window);
70 aura::client::ParentWindowWithContext(window, root_window(), gfx::Rect()); 70 aura::client::ParentWindowWithContext(window, root_window(), gfx::Rect());
71 return window; 71 return window;
72 } 72 }
73 73
74 private: 74 private:
75 scoped_ptr<wm::WMState> wm_state_; 75 scoped_ptr<wm::WMState> wm_state_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(TransientWindowManagerTest); 77 DISALLOW_COPY_AND_ASSIGN(TransientWindowManagerTest);
78 }; 78 };
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 } // namespace 358 } // namespace
359 359
360 // Verifies the delegate is notified of destruction after transients are 360 // Verifies the delegate is notified of destruction after transients are
361 // destroyed. 361 // destroyed.
362 TEST_F(TransientWindowManagerTest, NotifyDelegateAfterDeletingTransients) { 362 TEST_F(TransientWindowManagerTest, NotifyDelegateAfterDeletingTransients) {
363 std::vector<std::string> destruction_order; 363 std::vector<std::string> destruction_order;
364 364
365 DestroyedTrackingDelegate parent_delegate("parent", &destruction_order); 365 DestroyedTrackingDelegate parent_delegate("parent", &destruction_order);
366 scoped_ptr<Window> parent(new Window(&parent_delegate)); 366 scoped_ptr<Window> parent(new Window(&parent_delegate));
367 parent->Init(aura::WINDOW_LAYER_NOT_DRAWN); 367 parent->Init(ui::LAYER_NOT_DRAWN);
368 368
369 DestroyedTrackingDelegate transient_delegate("transient", &destruction_order); 369 DestroyedTrackingDelegate transient_delegate("transient", &destruction_order);
370 Window* transient = new Window(&transient_delegate); // Owned by |parent|. 370 Window* transient = new Window(&transient_delegate); // Owned by |parent|.
371 transient->Init(aura::WINDOW_LAYER_NOT_DRAWN); 371 transient->Init(ui::LAYER_NOT_DRAWN);
372 AddTransientChild(parent.get(), transient); 372 AddTransientChild(parent.get(), transient);
373 parent.reset(); 373 parent.reset();
374 374
375 ASSERT_EQ(2u, destruction_order.size()); 375 ASSERT_EQ(2u, destruction_order.size());
376 EXPECT_EQ("transient", destruction_order[0]); 376 EXPECT_EQ("transient", destruction_order[0]);
377 EXPECT_EQ("parent", destruction_order[1]); 377 EXPECT_EQ("parent", destruction_order[1]);
378 } 378 }
379 379
380 TEST_F(TransientWindowManagerTest, 380 TEST_F(TransientWindowManagerTest,
381 StackTransientsLayersRelativeToOtherTransients) { 381 StackTransientsLayersRelativeToOtherTransients) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 EXPECT_EQ(0, test_observer.remove_count()); 417 EXPECT_EQ(0, test_observer.remove_count());
418 418
419 RemoveTransientChild(parent.get(), w1.get()); 419 RemoveTransientChild(parent.get(), w1.get());
420 EXPECT_EQ(1, test_observer.add_count()); 420 EXPECT_EQ(1, test_observer.add_count());
421 EXPECT_EQ(1, test_observer.remove_count()); 421 EXPECT_EQ(1, test_observer.remove_count());
422 422
423 TransientWindowManager::Get(parent.get())->RemoveObserver(&test_observer); 423 TransientWindowManager::Get(parent.get())->RemoveObserver(&test_observer);
424 } 424 }
425 425
426 } // namespace wm 426 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/shadow_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698