| 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 23 matching lines...) Expand all Loading... |
| 34 // Add the application switch. | 34 // Add the application switch. |
| 35 CommandLine::ForCurrentProcess()->AppendSwitchASCII(::switches::kAppId, | 35 CommandLine::ForCurrentProcess()->AppendSwitchASCII(::switches::kAppId, |
| 36 kTestAppName); | 36 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", "Someone"); | 44 manifest.SetString("author.email", "Someone"); |
| 45 | 45 |
| 46 std::string error; | 46 std::string error; |
| 47 correct_extension_ = | 47 correct_extension_ = |
| 48 extensions::Extension::Create(base::FilePath(), | 48 extensions::Extension::Create(base::FilePath(), |
| 49 extensions::Manifest::UNPACKED, | 49 extensions::Manifest::UNPACKED, |
| 50 manifest, | 50 manifest, |
| 51 extensions::Extension::NO_FLAGS, | 51 extensions::Extension::NO_FLAGS, |
| 52 kTestAppName, | 52 kTestAppName, |
| 53 &error); | 53 &error); |
| 54 base::DictionaryValue manifest2; | 54 base::DictionaryValue manifest2; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Check that an invalid app gets shown accordingly. | 139 // Check that an invalid app gets shown accordingly. |
| 140 TEST_F(IdleAppNameNotificationViewTest, CheckInvalidApp) { | 140 TEST_F(IdleAppNameNotificationViewTest, CheckInvalidApp) { |
| 141 // Create a message which is visible for 10ms and fades in/out for 5ms. | 141 // Create a message which is visible for 10ms and fades in/out for 5ms. |
| 142 scoped_ptr<chromeos::IdleAppNameNotificationView> message( | 142 scoped_ptr<chromeos::IdleAppNameNotificationView> message( |
| 143 new chromeos::IdleAppNameNotificationView(10, 5, NULL)); | 143 new chromeos::IdleAppNameNotificationView(10, 5, NULL)); |
| 144 base::string16 text = message->GetShownTextForTest(); | 144 base::string16 text = message->GetShownTextForTest(); |
| 145 base::string16 error = l10n_util::GetStringUTF16( | 145 base::string16 error = l10n_util::GetStringUTF16( |
| 146 IDS_IDLE_APP_NAME_UNKNOWN_APPLICATION_NOTIFICATION); | 146 IDS_IDLE_APP_NAME_UNKNOWN_APPLICATION_NOTIFICATION); |
| 147 EXPECT_EQ(error, text); | 147 EXPECT_EQ(error, text); |
| 148 } | 148 } |
| OLD | NEW |