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

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

Issue 10700130: Introduce LaunchParams struct for opening chrome apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bad merge Created 8 years, 5 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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/app_notify_channel_setup.h" 6 #include "chrome/browser/extensions/app_notify_channel_setup.h"
7 #include "chrome/browser/extensions/extension_browsertest.h" 7 #include "chrome/browser/extensions/extension_browsertest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // A test that makes sure we properly save the client id we were passed when 52 // A test that makes sure we properly save the client id we were passed when
53 // the app called the getNotificationChannel API. 53 // the app called the getNotificationChannel API.
54 IN_PROC_BROWSER_TEST_F(AppNotificationTest, SaveClientId) { 54 IN_PROC_BROWSER_TEST_F(AppNotificationTest, SaveClientId) {
55 Interceptor interceptor; 55 Interceptor interceptor;
56 AppNotifyChannelSetup::SetInterceptorForTests(&interceptor); 56 AppNotifyChannelSetup::SetInterceptorForTests(&interceptor);
57 57
58 const extensions::Extension* app = 58 const extensions::Extension* app =
59 LoadExtension(test_data_dir_.AppendASCII("app_notifications")); 59 LoadExtension(test_data_dir_.AppendASCII("app_notifications"));
60 ASSERT_TRUE(app != NULL); 60 ASSERT_TRUE(app != NULL);
61 61
62 application_launch::OpenApplication(browser()->profile(), 62 application_launch::OpenApplication(application_launch::LaunchParams(
63 app, 63 browser()->profile(), app, extension_misc::LAUNCH_TAB,
64 extension_misc::LAUNCH_TAB, 64 NEW_FOREGROUND_TAB));
65 GURL(),
66 NEW_FOREGROUND_TAB,
67 NULL);
68 if (!interceptor.was_called()) 65 if (!interceptor.was_called())
69 ui_test_utils::RunMessageLoop(); 66 ui_test_utils::RunMessageLoop();
70 EXPECT_TRUE(interceptor.was_called()); 67 EXPECT_TRUE(interceptor.was_called());
71 68
72 ExtensionService* service = browser()->profile()->GetExtensionService(); 69 ExtensionService* service = browser()->profile()->GetExtensionService();
73 extensions::ExtensionPrefs* prefs = service->extension_prefs(); 70 extensions::ExtensionPrefs* prefs = service->extension_prefs();
74 std::string saved_id = prefs->GetAppNotificationClientId(app->id()); 71 std::string saved_id = prefs->GetAppNotificationClientId(app->id());
75 EXPECT_EQ(kExpectedClientId, saved_id); 72 EXPECT_EQ(kExpectedClientId, saved_id);
76 } 73 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager_util.cc ('k') | chrome/browser/extensions/extension_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698