| OLD | NEW |
| 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 Loading... |
| 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 InfoBar* infobar = infobar_service->infobar_at(0); | 112 InfoBarDelegate* infobar = infobar_service->infobar_at(0); |
| 113 ConfirmInfoBarDelegate* delegate = | 113 ConfirmInfoBarDelegate* delegate = infobar->AsConfirmInfoBarDelegate(); |
| 114 infobar->delegate()->AsConfirmInfoBarDelegate(); | |
| 115 ASSERT_TRUE(delegate != NULL); | 114 ASSERT_TRUE(delegate != NULL); |
| 116 if (should_accept_) | 115 if (should_accept_) |
| 117 delegate->Accept(); | 116 delegate->Accept(); |
| 118 else | 117 else |
| 119 delegate->Cancel(); | 118 delegate->Cancel(); |
| 120 | 119 |
| 121 infobar_service->RemoveInfoBar(infobar); | 120 infobar_service->RemoveInfoBar(infobar); |
| 122 } | 121 } |
| 123 | 122 |
| 124 PPAPITestBase::PPAPITestBase() { | 123 PPAPITestBase::PPAPITestBase() { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 const std::string& base, | 382 const std::string& base, |
| 384 const std::string& test_case) { | 383 const std::string& test_case) { |
| 385 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 384 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
| 386 test_case.c_str()); | 385 test_case.c_str()); |
| 387 } | 386 } |
| 388 | 387 |
| 389 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 388 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
| 390 // The default content setting for the PPAPI broker is ASK. We purposefully | 389 // The default content setting for the PPAPI broker is ASK. We purposefully |
| 391 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 390 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
| 392 } | 391 } |
| OLD | NEW |