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 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1474 //////////////////////////////////////////////////////////////////////////////// | 1474 //////////////////////////////////////////////////////////////////////////////// |
1475 // Accelerators | 1475 // Accelerators |
1476 //////////////////////////////////////////////////////////////////////////////// | 1476 //////////////////////////////////////////////////////////////////////////////// |
1477 bool TestView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 1477 bool TestView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
1478 accelerator_count_map_[accelerator]++; | 1478 accelerator_count_map_[accelerator]++; |
1479 return true; | 1479 return true; |
1480 } | 1480 } |
1481 | 1481 |
1482 // TODO: these tests were initially commented out when getting aura to | 1482 // TODO: these tests were initially commented out when getting aura to |
1483 // run. Figure out if still valuable and either nuke or fix. | 1483 // run. Figure out if still valuable and either nuke or fix. |
1484 #if defined(false) | 1484 #if 0 |
1485 TEST_F(ViewTest, ActivateAccelerator) { | 1485 TEST_F(ViewTest, ActivateAccelerator) { |
1486 // Register a keyboard accelerator before the view is added to a window. | 1486 // Register a keyboard accelerator before the view is added to a window. |
1487 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); | 1487 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); |
1488 TestView* view = new TestView(); | 1488 TestView* view = new TestView(); |
1489 view->Reset(); | 1489 view->Reset(); |
1490 view->AddAccelerator(return_accelerator); | 1490 view->AddAccelerator(return_accelerator); |
1491 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); | 1491 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); |
1492 | 1492 |
1493 // Create a window and add the view as its child. | 1493 // Create a window and add the view as its child. |
1494 scoped_ptr<Widget> widget(new Widget); | 1494 scoped_ptr<Widget> widget(new Widget); |
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3613 ViewStorage* view_storage = ViewStorage::GetInstance(); | 3613 ViewStorage* view_storage = ViewStorage::GetInstance(); |
3614 const int storage_id = view_storage->CreateStorageID(); | 3614 const int storage_id = view_storage->CreateStorageID(); |
3615 { | 3615 { |
3616 View view; | 3616 View view; |
3617 view_storage->StoreView(storage_id, &view); | 3617 view_storage->StoreView(storage_id, &view); |
3618 } | 3618 } |
3619 EXPECT_TRUE(view_storage->RetrieveView(storage_id) == NULL); | 3619 EXPECT_TRUE(view_storage->RetrieveView(storage_id) == NULL); |
3620 } | 3620 } |
3621 | 3621 |
3622 } // namespace views | 3622 } // namespace views |
OLD | NEW |