| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/views/frame/web_contents_close_handler.h" | 5 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" |
| 6 | 6 |
| 7 #include "base/macros.h" |
| 7 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 8 #include "chrome/browser/ui/views/frame/web_contents_close_handler_delegate.h" | 9 #include "chrome/browser/ui/views/frame/web_contents_close_handler_delegate.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 class MockWebContentsCloseHandlerDelegate | 12 class MockWebContentsCloseHandlerDelegate |
| 12 : public WebContentsCloseHandlerDelegate { | 13 : public WebContentsCloseHandlerDelegate { |
| 13 public: | 14 public: |
| 14 explicit MockWebContentsCloseHandlerDelegate() | 15 explicit MockWebContentsCloseHandlerDelegate() |
| 15 : got_clone_(false), | 16 : got_clone_(false), |
| 16 got_destroy_(false) { | 17 got_destroy_(false) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // Verifies the timer is started after a close. | 84 // Verifies the timer is started after a close. |
| 84 TEST_F(WebContentsCloseHandlerTest, DontDestroyImmediatleyAfterCancel) { | 85 TEST_F(WebContentsCloseHandlerTest, DontDestroyImmediatleyAfterCancel) { |
| 85 close_handler_.WillCloseAllTabs(); | 86 close_handler_.WillCloseAllTabs(); |
| 86 close_handler_delegate_.Clear(); | 87 close_handler_delegate_.Clear(); |
| 87 close_handler_.CloseAllTabsCanceled(); | 88 close_handler_.CloseAllTabsCanceled(); |
| 88 EXPECT_FALSE(close_handler_delegate_.got_destroy()); | 89 EXPECT_FALSE(close_handler_delegate_.got_destroy()); |
| 89 EXPECT_FALSE(close_handler_delegate_.got_clone()); | 90 EXPECT_FALSE(close_handler_delegate_.got_clone()); |
| 90 EXPECT_TRUE(IsTimerRunning()); | 91 EXPECT_TRUE(IsTimerRunning()); |
| 91 } | 92 } |
| 92 | 93 |
| OLD | NEW |