Chromium Code Reviews| 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/browser/ui/ash/launcher/chrome_launcher_controller_per_browser. h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser. h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/ash_switches.h" | |
| 11 #include "ash/launcher/launcher_model.h" | 12 #include "ash/launcher/launcher_model.h" |
| 12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 17 #include "base/values.h" | 18 #include "base/values.h" |
| 18 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
| 19 #include "chrome/browser/extensions/test_extension_system.h" | 20 #include "chrome/browser/extensions/test_extension_system.h" |
| 20 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 21 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 using extensions::Extension; | 36 using extensions::Extension; |
| 36 using extensions::Manifest; | 37 using extensions::Manifest; |
| 37 | 38 |
| 38 class ChromeLauncherControllerPerBrowserTest : public testing::Test { | 39 class ChromeLauncherControllerPerBrowserTest : public testing::Test { |
| 39 protected: | 40 protected: |
| 40 ChromeLauncherControllerPerBrowserTest() | 41 ChromeLauncherControllerPerBrowserTest() |
| 41 : profile_(new TestingProfile()), | 42 : profile_(new TestingProfile()), |
| 42 extension_service_(NULL) { | 43 extension_service_(NULL) { |
| 44 CommandLine::ForCurrentProcess()->AppendSwitch( | |
|
Harry McCleave
2013/08/21 21:34:43
ChromeLaun...PerBrowser is being removed (cl in th
James Cook
2013/08/22 00:19:12
Just FYI: The original removal got reverted, but I
| |
| 45 ash::switches::kAshDisableAlternateShelfLayout); | |
| 43 DictionaryValue manifest; | 46 DictionaryValue manifest; |
| 44 manifest.SetString("name", "launcher controller test extension"); | 47 manifest.SetString("name", "launcher controller test extension"); |
| 45 manifest.SetString("version", "1"); | 48 manifest.SetString("version", "1"); |
| 46 manifest.SetString("description", "for testing pinned apps"); | 49 manifest.SetString("description", "for testing pinned apps"); |
| 47 | 50 |
| 48 extensions::TestExtensionSystem* extension_system( | 51 extensions::TestExtensionSystem* extension_system( |
| 49 static_cast<extensions::TestExtensionSystem*>( | 52 static_cast<extensions::TestExtensionSystem*>( |
| 50 extensions::ExtensionSystem::Get(profile_.get()))); | 53 extensions::ExtensionSystem::Get(profile_.get()))); |
| 51 extension_service_ = extension_system->CreateExtensionService( | 54 extension_service_ = extension_system->CreateExtensionService( |
| 52 CommandLine::ForCurrentProcess(), base::FilePath(), false); | 55 CommandLine::ForCurrentProcess(), base::FilePath(), false); |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 | 456 |
| 454 GetAppLaunchers(&controller, &actual_launchers); | 457 GetAppLaunchers(&controller, &actual_launchers); |
| 455 EXPECT_EQ(expected_launchers, actual_launchers); | 458 EXPECT_EQ(expected_launchers, actual_launchers); |
| 456 | 459 |
| 457 // Install |extension2| and verify it shows up between the other two. | 460 // Install |extension2| and verify it shows up between the other two. |
| 458 extension_service_->AddExtension(extension2_.get()); | 461 extension_service_->AddExtension(extension2_.get()); |
| 459 expected_launchers.insert(expected_launchers.begin() + 1, extension2_->id()); | 462 expected_launchers.insert(expected_launchers.begin() + 1, extension2_->id()); |
| 460 GetAppLaunchers(&controller, &actual_launchers); | 463 GetAppLaunchers(&controller, &actual_launchers); |
| 461 EXPECT_EQ(expected_launchers, actual_launchers); | 464 EXPECT_EQ(expected_launchers, actual_launchers); |
| 462 } | 465 } |
| OLD | NEW |