OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
6 #include "apps/shell_window.h" | 6 #include "apps/shell_window.h" |
7 #include "apps/shell_window_registry.h" | 7 #include "apps/shell_window_registry.h" |
8 #include "apps/ui/native_app_window.h" | 8 #include "apps/ui/native_app_window.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "chrome/test/base/test_switches.h" | 36 #include "chrome/test/base/test_switches.h" |
37 #include "chrome/test/base/ui_test_utils.h" | 37 #include "chrome/test/base/ui_test_utils.h" |
38 #include "components/user_prefs/pref_registry_syncable.h" | 38 #include "components/user_prefs/pref_registry_syncable.h" |
39 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 39 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
40 #include "content/public/browser/devtools_agent_host.h" | 40 #include "content/public/browser/devtools_agent_host.h" |
41 #include "content/public/browser/render_process_host.h" | 41 #include "content/public/browser/render_process_host.h" |
42 #include "content/public/browser/render_widget_host_view.h" | 42 #include "content/public/browser/render_widget_host_view.h" |
43 #include "content/public/browser/web_contents_view.h" | 43 #include "content/public/browser/web_contents_view.h" |
44 #include "content/public/test/test_utils.h" | 44 #include "content/public/test/test_utils.h" |
45 #include "extensions/browser/event_router.h" | 45 #include "extensions/browser/event_router.h" |
| 46 #include "extensions/browser/pref_names.h" |
46 #include "net/test/embedded_test_server/embedded_test_server.h" | 47 #include "net/test/embedded_test_server/embedded_test_server.h" |
47 #include "url/gurl.h" | 48 #include "url/gurl.h" |
48 | 49 |
49 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
50 #include "base/memory/scoped_ptr.h" | 51 #include "base/memory/scoped_ptr.h" |
51 #include "chrome/browser/chromeos/login/mock_user_manager.h" | 52 #include "chrome/browser/chromeos/login/mock_user_manager.h" |
52 #include "chrome/browser/chromeos/login/user_manager.h" | 53 #include "chrome/browser/chromeos/login/user_manager.h" |
53 #include "chromeos/dbus/dbus_thread_manager.h" | 54 #include "chromeos/dbus/dbus_thread_manager.h" |
54 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 55 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
55 #include "chromeos/dbus/fake_power_manager_client.h" | 56 #include "chromeos/dbus/fake_power_manager_client.h" |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 // Simulate a "downgrade" from version 2 in the test manifest.json to 1. | 1019 // Simulate a "downgrade" from version 2 in the test manifest.json to 1. |
1019 ExtensionPrefs* extension_prefs = | 1020 ExtensionPrefs* extension_prefs = |
1020 extensions::ExtensionSystem::Get(browser()->profile())-> | 1021 extensions::ExtensionSystem::Get(browser()->profile())-> |
1021 extension_service()->extension_prefs(); | 1022 extension_service()->extension_prefs(); |
1022 | 1023 |
1023 // Clear the registered events to ensure they are updated. | 1024 // Clear the registered events to ensure they are updated. |
1024 extensions::ExtensionSystem::Get(browser()->profile())->event_router()-> | 1025 extensions::ExtensionSystem::Get(browser()->profile())->event_router()-> |
1025 SetRegisteredEvents(extension->id(), std::set<std::string>()); | 1026 SetRegisteredEvents(extension->id(), std::set<std::string>()); |
1026 | 1027 |
1027 DictionaryPrefUpdate update(extension_prefs->pref_service(), | 1028 DictionaryPrefUpdate update(extension_prefs->pref_service(), |
1028 prefs::kExtensionsPref); | 1029 extensions::pref_names::kExtensions); |
1029 base::DictionaryValue* dict = update.Get(); | 1030 base::DictionaryValue* dict = update.Get(); |
1030 std::string key(extension->id()); | 1031 std::string key(extension->id()); |
1031 key += ".manifest.version"; | 1032 key += ".manifest.version"; |
1032 dict->SetString(key, "1"); | 1033 dict->SetString(key, "1"); |
1033 } | 1034 } |
1034 | 1035 |
1035 // Component App Test 3 of 3: simulate a component extension upgrade that | 1036 // Component App Test 3 of 3: simulate a component extension upgrade that |
1036 // re-adds the OnLaunched event, and allows the app to be launched. | 1037 // re-adds the OnLaunched event, and allows the app to be launched. |
1037 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ComponentAppBackgroundPage) { | 1038 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ComponentAppBackgroundPage) { |
1038 CheckExtensionInstalledObserver should_install; | 1039 CheckExtensionInstalledObserver should_install; |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 | 1327 |
1327 ExtensionApiTest::ResultCatcher result_catcher; | 1328 ExtensionApiTest::ResultCatcher result_catcher; |
1328 | 1329 |
1329 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 1330 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
1330 | 1331 |
1331 EXPECT_TRUE(result_catcher.GetNextResult()); | 1332 EXPECT_TRUE(result_catcher.GetNextResult()); |
1332 } | 1333 } |
1333 } | 1334 } |
1334 | 1335 |
1335 } // namespace extensions | 1336 } // namespace extensions |
OLD | NEW |