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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "ui/base/accelerators/accelerator.h" | 12 #include "ui/base/accelerators/accelerator.h" |
13 #include "ui/base/clipboard/clipboard.h" | 13 #include "ui/base/clipboard/clipboard.h" |
| 14 #include "ui/base/event.h" |
14 #include "ui/base/keycodes/keyboard_codes.h" | 15 #include "ui/base/keycodes/keyboard_codes.h" |
15 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
16 #include "ui/base/models/simple_menu_model.h" | 17 #include "ui/base/models/simple_menu_model.h" |
17 #include "ui/compositor/compositor.h" | 18 #include "ui/compositor/compositor.h" |
18 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
19 #include "ui/compositor/layer_animator.h" | 20 #include "ui/compositor/layer_animator.h" |
20 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
21 #include "ui/gfx/path.h" | 22 #include "ui/gfx/path.h" |
22 #include "ui/gfx/transform.h" | 23 #include "ui/gfx/transform.h" |
23 #include "ui/views/background.h" | 24 #include "ui/views/background.h" |
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 ok_button_ = client_view_->ok_button(); | 1663 ok_button_ = client_view_->ok_button(); |
1663 cancel_button_ = client_view_->cancel_button(); | 1664 cancel_button_ = client_view_->cancel_button(); |
1664 } | 1665 } |
1665 | 1666 |
1666 virtual void TearDown() OVERRIDE { | 1667 virtual void TearDown() OVERRIDE { |
1667 test_dialog_->TearDown(); | 1668 test_dialog_->TearDown(); |
1668 ViewTest::TearDown(); | 1669 ViewTest::TearDown(); |
1669 } | 1670 } |
1670 | 1671 |
1671 void SimulatePressingEnterAndCheckDefaultButton(ButtonID button_id) { | 1672 void SimulatePressingEnterAndCheckDefaultButton(ButtonID button_id) { |
1672 KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, 0); | 1673 ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, 0); |
1673 focus_manager_->OnKeyEvent(event); | 1674 focus_manager_->OnKeyEvent(event); |
1674 switch (button_id) { | 1675 switch (button_id) { |
1675 case OK: | 1676 case OK: |
1676 EXPECT_TRUE(test_dialog_->oked_); | 1677 EXPECT_TRUE(test_dialog_->oked_); |
1677 EXPECT_FALSE(test_dialog_->canceled_); | 1678 EXPECT_FALSE(test_dialog_->canceled_); |
1678 EXPECT_FALSE(test_dialog_->last_pressed_button_); | 1679 EXPECT_FALSE(test_dialog_->last_pressed_button_); |
1679 break; | 1680 break; |
1680 case CANCEL: | 1681 case CANCEL: |
1681 EXPECT_FALSE(test_dialog_->oked_); | 1682 EXPECT_FALSE(test_dialog_->oked_); |
1682 EXPECT_TRUE(test_dialog_->canceled_); | 1683 EXPECT_TRUE(test_dialog_->canceled_); |
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3335 // Set to non default value. | 3336 // Set to non default value. |
3336 v->layer()->set_scale_content(false); | 3337 v->layer()->set_scale_content(false); |
3337 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); | 3338 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); |
3338 ui::Layer* new_layer = v->layer(); | 3339 ui::Layer* new_layer = v->layer(); |
3339 EXPECT_FALSE(new_layer->scale_content()); | 3340 EXPECT_FALSE(new_layer->scale_content()); |
3340 } | 3341 } |
3341 | 3342 |
3342 #endif // USE_AURA | 3343 #endif // USE_AURA |
3343 | 3344 |
3344 } // namespace views | 3345 } // namespace views |
OLD | NEW |