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

Unified Diff: chrome/browser/extensions/app_notification_browsertest.cc

Issue 12680004: Remove chrome/ code to handle App Notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflicts. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/app_notification.cc ('k') | chrome/browser/extensions/app_notification_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_notification_browsertest.cc
diff --git a/chrome/browser/extensions/app_notification_browsertest.cc b/chrome/browser/extensions/app_notification_browsertest.cc
deleted file mode 100644
index d44921308c5c6ad75ee37f60784494af3c5ff85f..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/app_notification_browsertest.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/command_line.h"
-#include "chrome/browser/extensions/app_notify_channel_setup.h"
-#include "chrome/browser/extensions/extension_browsertest.h"
-#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/extension_system.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/extensions/application_launch.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/extensions/extension.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "content/public/browser/browser_thread.h"
-
-using content::BrowserThread;
-
-class AppNotificationTest : public ExtensionBrowserTest {};
-
-namespace extensions {
-
-namespace {
-
-// Our test app will call the getNotificationChannel API using this client id.
-static const char* kExpectedClientId = "dummy_client_id";
-
-class Interceptor : public AppNotifyChannelSetup::InterceptorForTests {
- public:
- Interceptor() : was_called_(false) {}
- virtual ~Interceptor() {}
-
- virtual void DoIntercept(
- const AppNotifyChannelSetup* setup,
- std::string* result_channel_id,
- AppNotifyChannelSetup::SetupError* result_error) OVERRIDE {
- EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI));
- EXPECT_TRUE(setup->client_id() == std::string(kExpectedClientId));
- *result_channel_id = std::string("1234");
- *result_error = AppNotifyChannelSetup::NONE;
- was_called_ = true;
- MessageLoop::current()->Quit();
- }
-
- bool was_called() const { return was_called_; }
-
- private:
- bool was_called_;
-};
-
-
-} // namespace
-
-// A test that makes sure we properly save the client id we were passed when
-// the app called the getNotificationChannel API.
-IN_PROC_BROWSER_TEST_F(AppNotificationTest, SaveClientId) {
- Interceptor interceptor;
- AppNotifyChannelSetup::SetInterceptorForTests(&interceptor);
-
- const Extension* app =
- LoadExtension(test_data_dir_.AppendASCII("app_notifications"));
- ASSERT_TRUE(app != NULL);
-
- chrome::OpenApplication(chrome::AppLaunchParams(browser()->profile(), app,
- extension_misc::LAUNCH_TAB,
- NEW_FOREGROUND_TAB));
- if (!interceptor.was_called())
- content::RunMessageLoop();
- EXPECT_TRUE(interceptor.was_called());
-
- ExtensionService* service = extensions::ExtensionSystem::Get(
- browser()->profile())->extension_service();
- ExtensionPrefs* prefs = service->extension_prefs();
- std::string saved_id = prefs->GetAppNotificationClientId(app->id());
- EXPECT_EQ(kExpectedClientId, saved_id);
-}
-
-} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/app_notification.cc ('k') | chrome/browser/extensions/app_notification_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698