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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "ui/base/accelerators/accelerator.h" | 6 #include "ui/base/accelerators/accelerator.h" |
7 #include "ui/base/keycodes/keyboard_codes.h" | 7 #include "ui/base/keycodes/keyboard_codes.h" |
8 #include "ui/views/controls/button/text_button.h" | 8 #include "ui/views/controls/button/text_button.h" |
9 #include "ui/views/controls/textfield/textfield.h" | 9 #include "ui/views/controls/textfield/textfield.h" |
10 #include "ui/views/focus/accelerator_handler.h" | 10 #include "ui/views/focus/accelerator_handler.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 EXPECT_EQ(target.accelerator_count(), 1); | 495 EXPECT_EQ(target.accelerator_count(), 1); |
496 } | 496 } |
497 | 497 |
498 class FocusManagerDtorTest : public FocusManagerTest { | 498 class FocusManagerDtorTest : public FocusManagerTest { |
499 protected: | 499 protected: |
500 typedef std::vector<std::string> DtorTrackVector; | 500 typedef std::vector<std::string> DtorTrackVector; |
501 | 501 |
502 class FocusManagerDtorTracked : public FocusManager { | 502 class FocusManagerDtorTracked : public FocusManager { |
503 public: | 503 public: |
504 FocusManagerDtorTracked(Widget* widget, DtorTrackVector* dtor_tracker) | 504 FocusManagerDtorTracked(Widget* widget, DtorTrackVector* dtor_tracker) |
505 : FocusManager(widget), | 505 : FocusManager(widget, NULL /* delegate */), |
506 dtor_tracker_(dtor_tracker) { | 506 dtor_tracker_(dtor_tracker) { |
507 } | 507 } |
508 | 508 |
509 virtual ~FocusManagerDtorTracked() { | 509 virtual ~FocusManagerDtorTracked() { |
510 dtor_tracker_->push_back("FocusManagerDtorTracked"); | 510 dtor_tracker_->push_back("FocusManagerDtorTracked"); |
511 } | 511 } |
512 | 512 |
513 DtorTrackVector* dtor_tracker_; | 513 DtorTrackVector* dtor_tracker_; |
514 | 514 |
515 private: | 515 private: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 598 |
599 // Test window, button and focus manager should all be destructed. | 599 // Test window, button and focus manager should all be destructed. |
600 ASSERT_EQ(3, static_cast<int>(dtor_tracker_.size())); | 600 ASSERT_EQ(3, static_cast<int>(dtor_tracker_.size())); |
601 | 601 |
602 // Focus manager should be the last one to destruct. | 602 // Focus manager should be the last one to destruct. |
603 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); | 603 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); |
604 } | 604 } |
605 #endif | 605 #endif |
606 | 606 |
607 } // namespace views | 607 } // namespace views |
OLD | NEW |