| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/chromeos/ui/idle_app_name_notification_view.h" | 5 #include "chrome/browser/chromeos/ui/idle_app_name_notification_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/test_extension_system.h" | 10 #include "chrome/browser/extensions/test_extension_system.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 Browser::TYPE_TABBED, | 25 Browser::TYPE_TABBED, |
| 26 chrome::HOST_DESKTOP_TYPE_ASH, | 26 chrome::HOST_DESKTOP_TYPE_ASH, |
| 27 false) { | 27 false) { |
| 28 } | 28 } |
| 29 | 29 |
| 30 virtual ~IdleAppNameNotificationViewTest() { | 30 virtual ~IdleAppNameNotificationViewTest() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual void SetUp() override { | 33 virtual void SetUp() override { |
| 34 // Add the application switch. | 34 // Add the application switch. |
| 35 CommandLine::ForCurrentProcess()->AppendSwitchASCII(::switches::kAppId, | 35 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 36 kTestAppName); | 36 ::switches::kAppId, kTestAppName); |
| 37 | 37 |
| 38 BrowserWithTestWindowTest::SetUp(); | 38 BrowserWithTestWindowTest::SetUp(); |
| 39 | 39 |
| 40 base::DictionaryValue manifest; | 40 base::DictionaryValue manifest; |
| 41 manifest.SetString(extensions::manifest_keys::kName, "Test"); | 41 manifest.SetString(extensions::manifest_keys::kName, "Test"); |
| 42 manifest.SetString(extensions::manifest_keys::kVersion, "1"); | 42 manifest.SetString(extensions::manifest_keys::kVersion, "1"); |
| 43 manifest.SetString(extensions::manifest_keys::kDescription, "Test app"); | 43 manifest.SetString(extensions::manifest_keys::kDescription, "Test app"); |
| 44 manifest.SetString("author.email", "Someone"); | 44 manifest.SetString("author.email", "Someone"); |
| 45 | 45 |
| 46 std::string error; | 46 std::string error; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // Check that an invalid app gets shown accordingly. | 123 // Check that an invalid app gets shown accordingly. |
| 124 TEST_F(IdleAppNameNotificationViewTest, CheckInvalidApp) { | 124 TEST_F(IdleAppNameNotificationViewTest, CheckInvalidApp) { |
| 125 // Create a message which is visible for 10ms and fades in/out for 5ms. | 125 // Create a message which is visible for 10ms and fades in/out for 5ms. |
| 126 scoped_ptr<chromeos::IdleAppNameNotificationView> message( | 126 scoped_ptr<chromeos::IdleAppNameNotificationView> message( |
| 127 new chromeos::IdleAppNameNotificationView(10, 5, NULL)); | 127 new chromeos::IdleAppNameNotificationView(10, 5, NULL)); |
| 128 base::string16 text = message->GetShownTextForTest(); | 128 base::string16 text = message->GetShownTextForTest(); |
| 129 base::string16 error = l10n_util::GetStringUTF16( | 129 base::string16 error = l10n_util::GetStringUTF16( |
| 130 IDS_IDLE_APP_NAME_UNKNOWN_APPLICATION_NOTIFICATION); | 130 IDS_IDLE_APP_NAME_UNKNOWN_APPLICATION_NOTIFICATION); |
| 131 EXPECT_EQ(error, text); | 131 EXPECT_EQ(error, text); |
| 132 } | 132 } |
| OLD | NEW |