| OLD | NEW |
| 1 // Copyright (c) 2011 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 <atlbase.h> | 5 #include <atlbase.h> |
| 6 #include <atlapp.h> | 6 #include <atlapp.h> |
| 7 #include <atlcrack.h> | 7 #include <atlcrack.h> |
| 8 #include <atlmisc.h> | 8 #include <atlmisc.h> |
| 9 #include <atlwin.h> | 9 #include <atlwin.h> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 } | 529 } |
| 530 | 530 |
| 531 EXPECT_CALL(*content, GetDesiredSize(80, 0)) | 531 EXPECT_CALL(*content, GetDesiredSize(80, 0)) |
| 532 .Times(testing::AnyNumber()).After(installed) | 532 .Times(testing::AnyNumber()).After(installed) |
| 533 .WillRepeatedly(testing::Return(infobar_height)); | 533 .WillRepeatedly(testing::Return(infobar_height)); |
| 534 | 534 |
| 535 ASSERT_NO_FATAL_FAILURE(infobar_window.Show(content)); | 535 ASSERT_NO_FATAL_FAILURE(infobar_window.Show(content)); |
| 536 | 536 |
| 537 ASSERT_NO_FATAL_FAILURE(check.Call("returned from Show")); | 537 ASSERT_NO_FATAL_FAILURE(check.Call("returned from Show")); |
| 538 | 538 |
| 539 ASSERT_NO_FATAL_FAILURE(message_loop.RunFor(10)); // seconds | 539 ASSERT_NO_FATAL_FAILURE(message_loop.RunFor( |
| 540 base::TimeDelta::FromSeconds(10))); |
| 540 | 541 |
| 541 window.DestroyWindow(); | 542 window.DestroyWindow(); |
| 542 | 543 |
| 543 ASSERT_FALSE(message_loop.WasTimedOut()); | 544 ASSERT_FALSE(message_loop.WasTimedOut()); |
| 544 } | 545 } |
| 545 | 546 |
| 546 TEST(InfobarsInfobarManagerTest, BasicTest) { | 547 TEST(InfobarsInfobarManagerTest, BasicTest) { |
| 547 chrome_frame_test::TimedMsgLoop message_loop; | 548 chrome_frame_test::TimedMsgLoop message_loop; |
| 548 | 549 |
| 549 int infobar_height = 40; | 550 int infobar_height = 40; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 infobar_height, | 586 infobar_height, |
| 586 &natural_dimensions))) | 587 &natural_dimensions))) |
| 587 .Times(testing::AnyNumber()) | 588 .Times(testing::AnyNumber()) |
| 588 .WillOnce(AsynchronousHideOnManager(&message_loop, manager)) | 589 .WillOnce(AsynchronousHideOnManager(&message_loop, manager)) |
| 589 .WillRepeatedly(testing::Return()); | 590 .WillRepeatedly(testing::Return()); |
| 590 | 591 |
| 591 EXPECT_CALL(*content, Die()).WillOnce(QUIT_LOOP(message_loop)); | 592 EXPECT_CALL(*content, Die()).WillOnce(QUIT_LOOP(message_loop)); |
| 592 | 593 |
| 593 ASSERT_TRUE(manager->Show(content, TOP_INFOBAR)); | 594 ASSERT_TRUE(manager->Show(content, TOP_INFOBAR)); |
| 594 | 595 |
| 595 message_loop.RunFor(10); // seconds | 596 message_loop.RunFor(base::TimeDelta::FromSeconds(10)); |
| 596 | 597 |
| 597 window.DestroyWindow(); | 598 window.DestroyWindow(); |
| 598 | 599 |
| 599 ASSERT_FALSE(message_loop.WasTimedOut()); | 600 ASSERT_FALSE(message_loop.WasTimedOut()); |
| 600 } | 601 } |
| 601 | 602 |
| 602 // TODO(erikwright): Write test for variations on return from default | 603 // TODO(erikwright): Write test for variations on return from default |
| 603 // OnNcCalcValidRects | 604 // OnNcCalcValidRects |
| OLD | NEW |