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

Unified Diff: chrome/browser/chromeos/extensions/screenlock_private_apitest.cc

Issue 289013002: cros: Clean up screenlockPrivate plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 | « no previous file | chrome/browser/chromeos/login/lock/screen_locker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/screenlock_private_apitest.cc
diff --git a/chrome/browser/chromeos/extensions/screenlock_private_apitest.cc b/chrome/browser/chromeos/extensions/screenlock_private_apitest.cc
deleted file mode 100644
index 50a7fda05d91a5277cdba697cba248de84f0cf6e..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/extensions/screenlock_private_apitest.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2013 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 "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/chromeos/login/auth/user_context.h"
-#include "chrome/browser/chromeos/login/lock/screen_locker.h"
-#include "chrome/browser/chromeos/login/users/user.h"
-#include "chrome/browser/extensions/extension_apitest.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
-#include "components/signin/core/browser/signin_manager.h"
-#include "content/public/browser/notification_service.h"
-#include "extensions/browser/api/test/test_api.h"
-
-namespace extensions {
-
-namespace {
-
-const char kAttemptClickAuthMessage[] = "attemptClickAuth";
-
-} // namespace
-
-class ScreenlockPrivateApiTest : public ExtensionApiTest,
- public content::NotificationObserver {
- public:
- ScreenlockPrivateApiTest() {}
-
- virtual ~ScreenlockPrivateApiTest() {}
-
- // ExtensionApiTest
- virtual void SetUpOnMainThread() OVERRIDE {
- SigninManagerFactory::GetForProfile(profile())
- ->SetAuthenticatedUsername("testuser@gmail.com");
- ExtensionApiTest::SetUpOnMainThread();
- }
-
- protected:
- chromeos::ScreenLocker* GetScreenLocker() {
- chromeos::ScreenLocker* locker =
- chromeos::ScreenLocker::default_screen_locker();
- EXPECT_TRUE(locker);
- return locker;
- }
-
- // ExtensionApiTest override:
- virtual void RunTestOnMainThreadLoop() OVERRIDE {
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
- content::NotificationService::AllSources());
- ExtensionApiTest::RunTestOnMainThreadLoop();
- registrar_.RemoveAll();
- }
-
- // content::NotificationObserver override:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE {
- const std::string& content = *content::Details<std::string>(details).ptr();
- if (content == kAttemptClickAuthMessage) {
- chromeos::ScreenLocker* locker = GetScreenLocker();
- const chromeos::UserList& users = locker->users();
- EXPECT_GE(1u, users.size());
- GetScreenLocker()->Authenticate(chromeos::UserContext(users[0]->email()));
- }
- }
-
- content::NotificationRegistrar registrar_;
-};
-
-IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) {
- ASSERT_TRUE(RunExtensionTest("screenlock_private/lock_unlock")) << message_;
-}
-
-IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) {
- ASSERT_TRUE(RunExtensionTest("screenlock_private/auth_type")) << message_;
-}
-
-} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/lock/screen_locker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698