| 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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 //////////////////////////////////////////////////////////////////////////////// | 1480 //////////////////////////////////////////////////////////////////////////////// |
| 1481 // Accelerators | 1481 // Accelerators |
| 1482 //////////////////////////////////////////////////////////////////////////////// | 1482 //////////////////////////////////////////////////////////////////////////////// |
| 1483 bool TestView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 1483 bool TestView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 1484 accelerator_count_map_[accelerator]++; | 1484 accelerator_count_map_[accelerator]++; |
| 1485 return true; | 1485 return true; |
| 1486 } | 1486 } |
| 1487 | 1487 |
| 1488 // TODO: these tests were initially commented out when getting aura to | 1488 // TODO: these tests were initially commented out when getting aura to |
| 1489 // run. Figure out if still valuable and either nuke or fix. | 1489 // run. Figure out if still valuable and either nuke or fix. |
| 1490 #if defined(false) | 1490 #if 0 |
| 1491 TEST_F(ViewTest, ActivateAccelerator) { | 1491 TEST_F(ViewTest, ActivateAccelerator) { |
| 1492 // Register a keyboard accelerator before the view is added to a window. | 1492 // Register a keyboard accelerator before the view is added to a window. |
| 1493 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); | 1493 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); |
| 1494 TestView* view = new TestView(); | 1494 TestView* view = new TestView(); |
| 1495 view->Reset(); | 1495 view->Reset(); |
| 1496 view->AddAccelerator(return_accelerator); | 1496 view->AddAccelerator(return_accelerator); |
| 1497 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); | 1497 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); |
| 1498 | 1498 |
| 1499 // Create a window and add the view as its child. | 1499 // Create a window and add the view as its child. |
| 1500 scoped_ptr<Widget> widget(new Widget); | 1500 scoped_ptr<Widget> widget(new Widget); |
| (...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3933 // notification. | 3933 // notification. |
| 3934 TestView* test_view_child_2 = new TestView(); | 3934 TestView* test_view_child_2 = new TestView(); |
| 3935 test_view->AddChildView(test_view_child_2); | 3935 test_view->AddChildView(test_view_child_2); |
| 3936 EXPECT_TRUE(test_view_child_2->native_theme_); | 3936 EXPECT_TRUE(test_view_child_2->native_theme_); |
| 3937 EXPECT_EQ(widget->GetNativeTheme(), test_view_child_2->native_theme_); | 3937 EXPECT_EQ(widget->GetNativeTheme(), test_view_child_2->native_theme_); |
| 3938 | 3938 |
| 3939 widget->CloseNow(); | 3939 widget->CloseNow(); |
| 3940 } | 3940 } |
| 3941 | 3941 |
| 3942 } // namespace views | 3942 } // namespace views |
| OLD | NEW |