| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Disabled right now as this won't work on BuildBots right now as this test | 5 // Disabled right now as this won't work on BuildBots right now as this test |
| 6 // require the box it runs on to be unlocked (and no screen-savers). | 6 // require the box it runs on to be unlocked (and no screen-savers). |
| 7 // The test actually simulates mouse and key events, so if the screen is locked, | 7 // The test actually simulates mouse and key events, so if the screen is locked, |
| 8 // the events don't go to the Chrome window. | 8 // the events don't go to the Chrome window. |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 } | 507 } |
| 508 | 508 |
| 509 FocusManagerTest::~FocusManagerTest() { | 509 FocusManagerTest::~FocusManagerTest() { |
| 510 } | 510 } |
| 511 | 511 |
| 512 TestViewWindow* FocusManagerTest::GetWindow() { | 512 TestViewWindow* FocusManagerTest::GetWindow() { |
| 513 return test_window_; | 513 return test_window_; |
| 514 } | 514 } |
| 515 | 515 |
| 516 void FocusManagerTest::SetUp() { | 516 void FocusManagerTest::SetUp() { |
| 517 OleInitialize(NULL); |
| 517 test_window_ = new TestViewWindow(this); | 518 test_window_ = new TestViewWindow(this); |
| 518 test_window_->Init(); | 519 test_window_->Init(); |
| 519 ShowWindow(test_window_->GetHWND(), SW_SHOW); | 520 ShowWindow(test_window_->GetHWND(), SW_SHOW); |
| 520 } | 521 } |
| 521 | 522 |
| 522 void FocusManagerTest::TearDown() { | 523 void FocusManagerTest::TearDown() { |
| 523 test_window_->CloseNow(); | 524 test_window_->CloseNow(); |
| 524 | 525 |
| 525 // Flush the message loop to make Purify happy. | 526 // Flush the message loop to make Purify happy. |
| 526 message_loop_.RunAllPending(); | 527 message_loop_.RunAllPending(); |
| 528 OleUninitialize(); |
| 527 } | 529 } |
| 528 | 530 |
| 529 //////////////////////////////////////////////////////////////////////////////// | 531 //////////////////////////////////////////////////////////////////////////////// |
| 530 // The tests | 532 // The tests |
| 531 //////////////////////////////////////////////////////////////////////////////// | 533 //////////////////////////////////////////////////////////////////////////////// |
| 532 | 534 |
| 533 | 535 |
| 534 TEST_F(FocusManagerTest, NormalTraversal) { | 536 TEST_F(FocusManagerTest, NormalTraversal) { |
| 535 const int kTraversalIDs[] = { kTopCheckBoxID, kAppleTextFieldID, | 537 const int kTraversalIDs[] = { kTopCheckBoxID, kAppleTextFieldID, |
| 536 kOrangeTextFieldID, kBananaTextFieldID, kKiwiTextFieldID, | 538 kOrangeTextFieldID, kBananaTextFieldID, kKiwiTextFieldID, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 EXPECT_TRUE(focused_view != NULL); | 658 EXPECT_TRUE(focused_view != NULL); |
| 657 if (focused_view) | 659 if (focused_view) |
| 658 EXPECT_EQ(kTraversalIDs[j], focused_view->GetID()); | 660 EXPECT_EQ(kTraversalIDs[j], focused_view->GetID()); |
| 659 } | 661 } |
| 660 } | 662 } |
| 661 */ | 663 */ |
| 662 } | 664 } |
| 663 | 665 |
| 664 } | 666 } |
| 665 | 667 |
| OLD | NEW |