OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 ui::Layer* layer = w.layer(); | 1761 ui::Layer* layer = w.layer(); |
1762 layer->set_scale_content(false); | 1762 layer->set_scale_content(false); |
1763 layer->SetVisible(false); | 1763 layer->SetVisible(false); |
1764 | 1764 |
1765 ui::Layer child_layer; | 1765 ui::Layer child_layer; |
1766 layer->Add(&child_layer); | 1766 layer->Add(&child_layer); |
1767 | 1767 |
1768 scoped_ptr<ui::Layer> old_layer(w.RecreateLayer()); | 1768 scoped_ptr<ui::Layer> old_layer(w.RecreateLayer()); |
1769 layer = w.layer(); | 1769 layer = w.layer(); |
1770 EXPECT_EQ(ui::LAYER_SOLID_COLOR, layer->type()); | 1770 EXPECT_EQ(ui::LAYER_SOLID_COLOR, layer->type()); |
1771 EXPECT_EQ(false, layer->scale_content()); | 1771 EXPECT_FALSE(layer->scale_content()); |
1772 EXPECT_EQ(false, layer->visible()); | 1772 EXPECT_FALSE(layer->visible()); |
1773 EXPECT_EQ(1u, layer->children().size()); | 1773 EXPECT_EQ(1u, layer->children().size()); |
1774 } | 1774 } |
1775 | 1775 |
1776 // Ensure that acquiring a layer then recreating a layer does not crash | 1776 // Ensure that acquiring a layer then recreating a layer does not crash |
1777 // and that RecreateLayer returns null. | 1777 // and that RecreateLayer returns null. |
1778 TEST_F(WindowTest, AcquireThenRecreateLayer) { | 1778 TEST_F(WindowTest, AcquireThenRecreateLayer) { |
1779 scoped_ptr<Window> w( | 1779 scoped_ptr<Window> w( |
1780 CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(0, 0, 100, 100), NULL)); | 1780 CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(0, 0, 100, 100), NULL)); |
1781 scoped_ptr<ui::Layer>acquired_layer(w->AcquireLayer()); | 1781 scoped_ptr<ui::Layer>acquired_layer(w->AcquireLayer()); |
1782 scoped_ptr<ui::Layer>doubly_acquired_layer(w->RecreateLayer()); | 1782 scoped_ptr<ui::Layer>doubly_acquired_layer(w->RecreateLayer()); |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2442 element->Step(start_time + base::TimeDelta::FromMilliseconds(1000)); | 2442 element->Step(start_time + base::TimeDelta::FromMilliseconds(1000)); |
2443 | 2443 |
2444 // No bounds changed notification at the end of animation since layer | 2444 // No bounds changed notification at the end of animation since layer |
2445 // delegate is NULL. | 2445 // delegate is NULL. |
2446 EXPECT_FALSE(delegate.bounds_changed()); | 2446 EXPECT_FALSE(delegate.bounds_changed()); |
2447 EXPECT_NE("0,0 100x100", window->bounds().ToString()); | 2447 EXPECT_NE("0,0 100x100", window->bounds().ToString()); |
2448 } | 2448 } |
2449 | 2449 |
2450 } // namespace test | 2450 } // namespace test |
2451 } // namespace aura | 2451 } // namespace aura |
OLD | NEW |