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/apps/app_browsertest_util.h" | 5 #include "chrome/browser/apps/app_browsertest_util.h" |
6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
7 #include "chrome/browser/extensions/extension_test_message_listener.h" | 7 #include "chrome/browser/extensions/extension_test_message_listener.h" |
8 #include "chrome/common/extensions/api/alarms.h" | 8 #include "chrome/common/extensions/api/alarms.h" |
9 #include "content/public/test/browser_test.h" | 9 #include "content/public/test/browser_test.h" |
10 #include "content/public/test/test_utils.h" | 10 #include "content/public/test/test_utils.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return NULL; | 71 return NULL; |
72 | 72 |
73 return extension; | 73 return extension; |
74 } | 74 } |
75 | 75 |
76 void CloseApp(const std::string& app_id) { | 76 void CloseApp(const std::string& app_id) { |
77 content::WindowedNotificationObserver event_page_destroyed_signal( | 77 content::WindowedNotificationObserver event_page_destroyed_signal( |
78 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 78 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
79 content::Source<Profile>(browser()->profile())); | 79 content::Source<Profile>(browser()->profile())); |
80 | 80 |
81 EXPECT_EQ(1U, GetShellWindowCountForApp(app_id)); | 81 EXPECT_EQ(1U, GetAppWindowCountForApp(app_id)); |
82 apps::ShellWindow* shell_window = GetFirstShellWindowForApp(app_id); | 82 apps::AppWindow* app_window = GetFirstAppWindowForApp(app_id); |
83 ASSERT_TRUE(shell_window); | 83 ASSERT_TRUE(app_window); |
84 CloseShellWindow(shell_window); | 84 CloseAppWindow(app_window); |
85 | 85 |
86 event_page_destroyed_signal.Wait(); | 86 event_page_destroyed_signal.Wait(); |
87 } | 87 } |
88 | 88 |
89 void VerifyAppNotLoaded(const std::string& app_id) { | 89 void VerifyAppNotLoaded(const std::string& app_id) { |
90 EXPECT_FALSE(ExtensionSystem::Get(browser()->profile())-> | 90 EXPECT_FALSE(ExtensionSystem::Get(browser()->profile())-> |
91 process_manager()->GetBackgroundHostForExtension(app_id)); | 91 process_manager()->GetBackgroundHostForExtension(app_id)); |
92 } | 92 } |
93 | 93 |
94 void DispatchAlarmEvent(EventRouter* event_router, | 94 void DispatchAlarmEvent(EventRouter* event_router, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 ExtensionSystem::Get(browser()->profile())->extension_service(); | 193 ExtensionSystem::Get(browser()->profile())->extension_service(); |
194 EXPECT_TRUE(service->UpdateExtension(app_id, app_v2_path, true, GURL(), | 194 EXPECT_TRUE(service->UpdateExtension(app_id, app_v2_path, true, GURL(), |
195 &crx_installer)); | 195 &crx_installer)); |
196 windowed_observer.Wait(); | 196 windowed_observer.Wait(); |
197 | 197 |
198 const Extension* app_v2 = service->GetExtensionById(app_id, false); | 198 const Extension* app_v2 = service->GetExtensionById(app_id, false); |
199 ASSERT_TRUE(app_v2); | 199 ASSERT_TRUE(app_v2); |
200 EXPECT_TRUE(app_v2->version()->CompareTo(app_original_version) > 0); | 200 EXPECT_TRUE(app_v2->version()->CompareTo(app_original_version) > 0); |
201 EXPECT_TRUE(app_v2->is_ephemeral()); | 201 EXPECT_TRUE(app_v2->is_ephemeral()); |
202 } | 202 } |
OLD | NEW |