OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/macros.h" |
5 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
6 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
7 #include "chrome/browser/download/download_request_infobar_delegate_android.h" | 8 #include "chrome/browser/download/download_request_infobar_delegate_android.h" |
8 #include "chrome/browser/download/download_request_limiter.h" | 9 #include "chrome/browser/download/download_request_limiter.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 // MockTabDownloadState ------------------------------------------------------- | 12 // MockTabDownloadState ------------------------------------------------------- |
12 | 13 |
13 class MockTabDownloadState : public DownloadRequestLimiter::TabDownloadState { | 14 class MockTabDownloadState : public DownloadRequestLimiter::TabDownloadState { |
14 public: | 15 public: |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (state.infobar_delegate()->Cancel()) | 87 if (state.infobar_delegate()->Cancel()) |
87 state.delete_infobar_delegate(); | 88 state.delete_infobar_delegate(); |
88 EXPECT_FALSE(state.accepted()); | 89 EXPECT_FALSE(state.accepted()); |
89 } | 90 } |
90 | 91 |
91 TEST(DownloadRequestInfoBarDelegateAndroid, CloseTest) { | 92 TEST(DownloadRequestInfoBarDelegateAndroid, CloseTest) { |
92 MockTabDownloadState state; | 93 MockTabDownloadState state; |
93 state.delete_infobar_delegate(); | 94 state.delete_infobar_delegate(); |
94 EXPECT_FALSE(state.accepted()); | 95 EXPECT_FALSE(state.accepted()); |
95 } | 96 } |
OLD | NEW |