| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/content_settings/tab_specific_content_settings.h" | 6 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 7 #include "chrome/browser/infobars/infobar_service.h" | 7 #include "chrome/browser/infobars/infobar_service.h" |
| 8 #include "chrome/browser/ui/content_settings/content_setting_changed_infobar_del
egate.h" | 8 #include "chrome/browser/ui/content_settings/content_setting_changed_infobar_del
egate.h" |
| 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 const int icon = IDR_INFOBAR_MEDIA_STREAM_CAMERA; | 63 const int icon = IDR_INFOBAR_MEDIA_STREAM_CAMERA; |
| 64 const int message = IDS_MEDIASTREAM_SETTING_CHANGED_INFOBAR_MESSAGE; | 64 const int message = IDS_MEDIASTREAM_SETTING_CHANGED_INFOBAR_MESSAGE; |
| 65 | 65 |
| 66 scoped_ptr<ContentSettingChangedInfoBarDelegate> infobar( | 66 scoped_ptr<ContentSettingChangedInfoBarDelegate> infobar( |
| 67 ContentSettingChangedInfoBarDelegate::CreateForUnitTest( | 67 ContentSettingChangedInfoBarDelegate::CreateForUnitTest( |
| 68 InfoBarService::FromWebContents(web_contents()), | 68 InfoBarService::FromWebContents(web_contents()), |
| 69 icon, | 69 icon, |
| 70 message)); | 70 message)); |
| 71 ConfirmInfoBarDelegate* c_infobar = infobar.get(); | 71 ConfirmInfoBarDelegate* c_infobar = infobar.get(); |
| 72 | 72 |
| 73 EXPECT_EQ(&ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon), | 73 EXPECT_EQ(icon, c_infobar->GetIconID()); |
| 74 c_infobar->GetIcon()); | |
| 75 EXPECT_FALSE(c_infobar->GetMessageText().compare( | 74 EXPECT_FALSE(c_infobar->GetMessageText().compare( |
| 76 l10n_util::GetStringUTF16(message))); | 75 l10n_util::GetStringUTF16(message))); |
| 77 | 76 |
| 78 EXPECT_EQ(1, observer.navigation_count()); | 77 EXPECT_EQ(1, observer.navigation_count()); |
| 79 EXPECT_TRUE(c_infobar->Accept()); | 78 EXPECT_TRUE(c_infobar->Accept()); |
| 80 EXPECT_EQ(2, observer.navigation_count()); | 79 EXPECT_EQ(2, observer.navigation_count()); |
| 81 } | 80 } |
| OLD | NEW |