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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } else { | 190 } else { |
191 // TODO(xiyuan): Figure out how to test extension installed bubble? | 191 // TODO(xiyuan): Figure out how to test extension installed bubble? |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 class NewTabUISortingBrowserTest : public ExtensionInstallUIBrowserTest, | 195 class NewTabUISortingBrowserTest : public ExtensionInstallUIBrowserTest, |
196 public content::NotificationObserver { | 196 public content::NotificationObserver { |
197 public: | 197 public: |
198 NewTabUISortingBrowserTest() {} | 198 NewTabUISortingBrowserTest() {} |
199 | 199 |
200 virtual void Observe(int type, | 200 void Observe(int type, |
201 const content::NotificationSource& source, | 201 const content::NotificationSource& source, |
202 const content::NotificationDetails& details) override { | 202 const content::NotificationDetails& details) override { |
203 if (type != chrome::NOTIFICATION_APP_LAUNCHER_REORDERED) { | 203 if (type != chrome::NOTIFICATION_APP_LAUNCHER_REORDERED) { |
204 observer_->Observe(type, source, details); | 204 observer_->Observe(type, source, details); |
205 return; | 205 return; |
206 } | 206 } |
207 const std::string* id = content::Details<const std::string>(details).ptr(); | 207 const std::string* id = content::Details<const std::string>(details).ptr(); |
208 EXPECT_TRUE(id); | 208 EXPECT_TRUE(id); |
209 last_reordered_extension_id_ = *id; | 209 last_reordered_extension_id_ = *id; |
210 } | 210 } |
211 | 211 |
212 protected: | 212 protected: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 sorting->OnExtensionMoved( | 244 sorting->OnExtensionMoved( |
245 app_id, std::string(), extensions::kWebStoreAppId); | 245 app_id, std::string(), extensions::kWebStoreAppId); |
246 EXPECT_EQ(app_id, last_reordered_extension_id_); | 246 EXPECT_EQ(app_id, last_reordered_extension_id_); |
247 | 247 |
248 // Now install the app. | 248 // Now install the app. |
249 const extensions::Extension* test_app = LoadExtension(app_dir); | 249 const extensions::Extension* test_app = LoadExtension(app_dir); |
250 ASSERT_TRUE(test_app); | 250 ASSERT_TRUE(test_app); |
251 EXPECT_TRUE(service->GetInstalledExtension(app_id)); | 251 EXPECT_TRUE(service->GetInstalledExtension(app_id)); |
252 EXPECT_EQ(app_id, test_app->id()); | 252 EXPECT_EQ(app_id, test_app->id()); |
253 } | 253 } |
OLD | NEW |