Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: chrome/browser/extensions/platform_app_browsertest.cc

Issue 10875027: Restart running apps when chrome restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/bind.h" 5 #include "base/bind.h"
6 #include "base/test/test_timeouts.h" 6 #include "base/test/test_timeouts.h"
7 #include "base/threading/platform_thread.h" 7 #include "base/threading/platform_thread.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/automation/automation_util.h" 10 #include "chrome/browser/automation/automation_util.h"
11 #include "chrome/browser/tab_contents/render_view_context_menu.h" 11 #include "chrome/browser/tab_contents/render_view_context_menu.h"
12 #include "chrome/browser/extensions/extension_browsertest.h" 12 #include "chrome/browser/extensions/extension_browsertest.h"
13 #include "chrome/browser/extensions/extension_prefs.h"
14 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/extensions/extension_system.h"
13 #include "chrome/browser/extensions/extension_test_message_listener.h" 16 #include "chrome/browser/extensions/extension_test_message_listener.h"
14 #include "chrome/browser/extensions/platform_app_browsertest_util.h" 17 #include "chrome/browser/extensions/platform_app_browsertest_util.h"
15 #include "chrome/browser/extensions/platform_app_launcher.h" 18 #include "chrome/browser/extensions/platform_app_launcher.h"
16 #include "chrome/browser/extensions/shell_window_registry.h" 19 #include "chrome/browser/extensions/shell_window_registry.h"
17 #include "chrome/browser/ui/browser.h" 20 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_tabstrip.h" 21 #include "chrome/browser/ui/browser_tabstrip.h"
19 #include "chrome/browser/ui/extensions/application_launch.h" 22 #include "chrome/browser/ui/extensions/application_launch.h"
20 #include "chrome/browser/ui/extensions/shell_window.h" 23 #include "chrome/browser/ui/extensions/shell_window.h"
21 #include "chrome/common/chrome_notification_types.h" 24 #include "chrome/common/chrome_notification_types.h"
22 #include "chrome/test/base/ui_test_utils.h" 25 #include "chrome/test/base/ui_test_utils.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 568
566 // Tell javascript to open a third window. 569 // Tell javascript to open a third window.
567 page3_listener.Reply("continue"); 570 page3_listener.Reply("continue");
568 571
569 // Wait for javascript to verify that the third window got the restored size 572 // Wait for javascript to verify that the third window got the restored size
570 // and explicitly specified coordinates. 573 // and explicitly specified coordinates.
571 ASSERT_TRUE(done3_listener.WaitUntilSatisfied()); 574 ASSERT_TRUE(done3_listener.WaitUntilSatisfied());
572 } 575 }
573 #endif // defined(TOOLKIT_GTK) || defined(OS_MACOSX) 576 #endif // defined(TOOLKIT_GTK) || defined(OS_MACOSX)
574 577
578 // Tests that a running app is recorded in the preferences as such.
579 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, RunningAppsAreRecorded) {
580 const Extension* extension = LoadExtension(
581 test_data_dir_.AppendASCII("platform_apps/restart_test"));
582 ASSERT_TRUE(extension);
583 ExtensionService* extension_service =
584 ExtensionSystem::Get(browser()->profile())->extension_service();
585 ExtensionPrefs* extension_prefs = extension_service->extension_prefs();
586 ASSERT_TRUE(extension_prefs->IsExtensionRunning(extension->id()));
Mihai Parparita -not on Chrome 2012/09/06 23:07:09 To make this test more comprehensive, you could th
koz (OOO until 15th September) 2012/09/10 04:51:57 Done.
587 }
588
575 } // namespace extensions 589 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698