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

Side by Side Diff: chrome/test/ppapi/ppapi_test.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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 | « chrome/test/gpu/webgl_infobar_browsertest.cc ('k') | tools/valgrind/memcheck/suppressions.txt » ('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) 2012 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 "chrome/test/ppapi/ppapi_test.h" 5 #include "chrome/test/ppapi/ppapi_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 ASSERT_TRUE(web_contents != NULL); 102 ASSERT_TRUE(web_contents != NULL);
103 InfoBarService* infobar_service = 103 InfoBarService* infobar_service =
104 InfoBarService::FromWebContents(web_contents); 104 InfoBarService::FromWebContents(web_contents);
105 ASSERT_TRUE(infobar_service != NULL); 105 ASSERT_TRUE(infobar_service != NULL);
106 106
107 EXPECT_EQ(expecting_infobar_ ? 1U : 0U, infobar_service->infobar_count()); 107 EXPECT_EQ(expecting_infobar_ ? 1U : 0U, infobar_service->infobar_count());
108 if (!expecting_infobar_) 108 if (!expecting_infobar_)
109 return; 109 return;
110 expecting_infobar_ = false; 110 expecting_infobar_ = false;
111 111
112 InfoBarDelegate* infobar = infobar_service->infobar_at(0); 112 InfoBar* infobar = infobar_service->infobar_at(0);
113 ConfirmInfoBarDelegate* delegate = infobar->AsConfirmInfoBarDelegate(); 113 ConfirmInfoBarDelegate* delegate =
114 infobar->delegate()->AsConfirmInfoBarDelegate();
114 ASSERT_TRUE(delegate != NULL); 115 ASSERT_TRUE(delegate != NULL);
115 if (should_accept_) 116 if (should_accept_)
116 delegate->Accept(); 117 delegate->Accept();
117 else 118 else
118 delegate->Cancel(); 119 delegate->Cancel();
119 120
120 infobar_service->RemoveInfoBar(infobar); 121 infobar_service->RemoveInfoBar(infobar);
121 } 122 }
122 123
123 PPAPITestBase::PPAPITestBase() { 124 PPAPITestBase::PPAPITestBase() {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 const std::string& base, 383 const std::string& base,
383 const std::string& test_case) { 384 const std::string& test_case) {
384 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), 385 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(),
385 test_case.c_str()); 386 test_case.c_str());
386 } 387 }
387 388
388 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { 389 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() {
389 // The default content setting for the PPAPI broker is ASK. We purposefully 390 // The default content setting for the PPAPI broker is ASK. We purposefully
390 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. 391 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way.
391 } 392 }
OLDNEW
« no previous file with comments | « chrome/test/gpu/webgl_infobar_browsertest.cc ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698