Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/download/download_request_infobar_delegate_unittest.cc

Issue 7294006: Try to bandaid leaks due to TabContentsWrapper not force-closing all InfoBarDelegates on shutdown... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/geolocation/chrome_geolocation_permission_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "chrome/browser/download/download_request_infobar_delegate.h" 6 #include "chrome/browser/download/download_request_infobar_delegate.h"
7 #include "chrome/browser/download/download_request_limiter.h" 7 #include "chrome/browser/download/download_request_limiter.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 // MockTabDownloadState ------------------------------------------------------- 10 // MockTabDownloadState -------------------------------------------------------
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 responded_ = true; 65 responded_ = true;
66 accepted_ = true; 66 accepted_ = true;
67 static_cast<DownloadRequestInfoBarDelegate*>(infobar_.get())->set_host(NULL); 67 static_cast<DownloadRequestInfoBarDelegate*>(infobar_.get())->set_host(NULL);
68 } 68 }
69 69
70 70
71 // Tests ---------------------------------------------------------------------- 71 // Tests ----------------------------------------------------------------------
72 72
73 TEST(DownloadRequestInfobarDelegate, AcceptTest) { 73 TEST(DownloadRequestInfobarDelegate, AcceptTest) {
74 MockTabDownloadState state; 74 MockTabDownloadState state;
75 state.infobar()->Accept(); 75 if (state.infobar()->Accept())
76 state.close_infobar();
76 EXPECT_TRUE(state.accepted()); 77 EXPECT_TRUE(state.accepted());
77 } 78 }
78 79
79 TEST(DownloadRequestInfobarDelegate, CancelTest) { 80 TEST(DownloadRequestInfobarDelegate, CancelTest) {
80 MockTabDownloadState state; 81 MockTabDownloadState state;
81 state.infobar()->Cancel(); 82 if (state.infobar()->Cancel())
83 state.close_infobar();
82 EXPECT_FALSE(state.accepted()); 84 EXPECT_FALSE(state.accepted());
83 } 85 }
84 86
85 TEST(DownloadRequestInfobarDelegate, CloseTest) { 87 TEST(DownloadRequestInfobarDelegate, CloseTest) {
86 MockTabDownloadState state; 88 MockTabDownloadState state;
87 state.close_infobar(); 89 state.close_infobar();
88 EXPECT_FALSE(state.accepted()); 90 EXPECT_FALSE(state.accepted());
89 } 91 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/geolocation/chrome_geolocation_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698