diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 03:08:49 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 03:08:49 +0000 |
commit | 39594f64142380e8ed8e06e10deb1396d0fa52dc (patch) | |
tree | f91eff5d77bee32c6c8a8ee95a1a2e958e2a1c7c /ash/test | |
parent | 8019cf950502180caa60a6cf7b52fc5934745e3f (diff) | |
download | chromium_src-39594f64142380e8ed8e06e10deb1396d0fa52dc.zip chromium_src-39594f64142380e8ed8e06e10deb1396d0fa52dc.tar.gz chromium_src-39594f64142380e8ed8e06e10deb1396d0fa52dc.tar.bz2 |
Revert 222957 "Refactors TestSystemTrayDelegate into DefaultSyst..."
It broke Aura windows builder
FAILED: ninja -t msvc -e environment.x86 -- C:\b\build\goma\gomacc.exe "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe" /nologo /showIncludes /FC @obj\ash\test\ash_test_support.test_system_tray_delegate.obj.rsp /c ..\..\ash\test\test_system_tray_delegate.cc /Foobj\ash\test\ash_test_support.test_system_tray_delegate.obj /Fdobj\ash\ash_test_support.pdb
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(24) : error C2220: warning treated as error - no 'object' file generated
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(24) : warning C4273: 'ash::test::TestSystemTrayDelegate::TestSystemTrayDelegate' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(15) : see previous definition of '{ctor}'
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(28) : warning C4273: 'ash::test::TestSystemTrayDelegate::~TestSystemTrayDelegate' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(16) : see previous definition of '{dtor}'
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(33) : warning C4273: 'ash::test::TestSystemTrayDelegate::SetInitialLoginStatus' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(23) : see previous definition of 'SetInitialLoginStatus'
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(37) : warning C4273: 'ash::test::TestSystemTrayDelegate::SetLoginStatus' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(30) : see previous definition of 'SetLoginStatus'
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(42) : warning C4273: 'ash::test::TestSystemTrayDelegate::GetUserLoginStatus' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(37) : see previous definition of 'GetUserLoginStatus'
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(61) : warning C4273: 'ash::test::TestSystemTrayDelegate::ShouldShowDisplayNotification' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(38) : see previous definition of 'ShouldShowDisplayNotification'
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(65) : warning C4273: 'ash::test::TestSystemTrayDelegate::ShutDown' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(39) : see previous definition of 'ShutDown'
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.cc(69) : warning C4273: 'ash::test::TestSystemTrayDelegate::SignOut' : inconsistent dll linkage
c:\b\build\slave\win_aura_builder\build\src\ash\test\test_system_tray_delegate.h(40) : see previous definition of 'SignOut'
ninja: build stopped: subcommand failed.
> Refactors TestSystemTrayDelegate into DefaultSystemTrayDelegate
>
> DefaultSystemTrayDelegate is the no-op implementation and
> TestSystemTrayDelegate contains the test related bits.
>
> This also fixes a crash in the windows side as
> TestSystemTrayDelegate::Shutdown() quits the message loop, which is
> the wrong thing to do.
>
> BUG=159693 284358
> TEST=none
> R=oshima@chromium.org
>
> Review URL: https://chromiumcodereview.appspot.com/23465018
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/23650004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/ash_test_helper.cc | 2 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.cc | 3 | ||||
-rw-r--r-- | ash/test/test_system_tray_delegate.cc | 74 | ||||
-rw-r--r-- | ash/test/test_system_tray_delegate.h | 52 |
4 files changed, 2 insertions, 129 deletions
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index e8ed5db..71af9e5 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc @@ -6,11 +6,11 @@ #include "ash/ash_switches.h" #include "ash/shell.h" +#include "ash/system/tray/test_system_tray_delegate.h" #include "ash/test/display_manager_test_api.h" #include "ash/test/shell_test_api.h" #include "ash/test/test_session_state_delegate.h" #include "ash/test/test_shell_delegate.h" -#include "ash/test/test_system_tray_delegate.h" #include "base/run_loop.h" #include "ui/aura/env.h" #include "ui/base/ime/input_method_initializer.h" diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index 4bd6083..bdbdfc8 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -14,7 +14,6 @@ #include "ash/shell_window_ids.h" #include "ash/test/test_launcher_delegate.h" #include "ash/test/test_session_state_delegate.h" -#include "ash/test/test_system_tray_delegate.h" #include "ash/wm/window_util.h" #include "base/logging.h" #include "content/public/test/test_browser_context.h" @@ -158,7 +157,7 @@ LauncherDelegate* TestShellDelegate::CreateLauncherDelegate( } SystemTrayDelegate* TestShellDelegate::CreateSystemTrayDelegate() { - return new TestSystemTrayDelegate; + return NULL; } UserWallpaperDelegate* TestShellDelegate::CreateUserWallpaperDelegate() { diff --git a/ash/test/test_system_tray_delegate.cc b/ash/test/test_system_tray_delegate.cc deleted file mode 100644 index 0f47aea..0000000 --- a/ash/test/test_system_tray_delegate.cc +++ /dev/null @@ -1,74 +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 "ash/test/test_system_tray_delegate.h" - -#include <string> - -#include "ash/session_state_delegate.h" -#include "ash/shell.h" -#include "base/message_loop/message_loop.h" -#include "base/time/time.h" - -namespace ash { -namespace test { - -namespace { - -user::LoginStatus g_initial_status = user::LOGGED_IN_USER; - -} // namespace - -TestSystemTrayDelegate::TestSystemTrayDelegate() - : should_show_display_notification_(false), - login_status_(g_initial_status) { -} - -TestSystemTrayDelegate::~TestSystemTrayDelegate() { -} - -// static -void TestSystemTrayDelegate::SetInitialLoginStatus( - user::LoginStatus login_status) { - g_initial_status = login_status; -} - -void TestSystemTrayDelegate::SetLoginStatus(user::LoginStatus login_status) { - login_status_ = login_status; - Shell::GetInstance()->UpdateAfterLoginStatusChange(login_status); -} - -user::LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { - // Initial login status has been changed for testing. - if (g_initial_status != user::LOGGED_IN_USER && - g_initial_status == login_status_) { - return login_status_; - } - - // At new user image screen manager->IsUserLoggedIn() would return true - // but there's no browser session available yet so use SessionStarted(). - SessionStateDelegate* delegate = - Shell::GetInstance()->session_state_delegate(); - - if (!delegate->IsActiveUserSessionStarted()) - return ash::user::LOGGED_IN_NONE; - if (delegate->IsScreenLocked()) - return user::LOGGED_IN_LOCKED; - return login_status_; -} - -bool TestSystemTrayDelegate::ShouldShowDisplayNotification() { - return should_show_display_notification_; -} - -void TestSystemTrayDelegate::ShutDown() { - base::MessageLoop::current()->Quit(); -} - -void TestSystemTrayDelegate::SignOut() { - base::MessageLoop::current()->Quit(); -} - -} // namespace test -} // namespace ash diff --git a/ash/test/test_system_tray_delegate.h b/ash/test/test_system_tray_delegate.h deleted file mode 100644 index 88e5146..0000000 --- a/ash/test/test_system_tray_delegate.h +++ /dev/null @@ -1,52 +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. - -#ifndef ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ -#define ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ - -#include "ash/system/tray/default_system_tray_delegate.h" - -namespace ash { -namespace test { - -class ASH_EXPORT TestSystemTrayDelegate : public DefaultSystemTrayDelegate { - public: - TestSystemTrayDelegate(); - virtual ~TestSystemTrayDelegate(); - - // Changes the login status when initially the delegate is created. This will - // be called before AshTestBase::SetUp() to test the case when chrome is - // restarted right after the login (such like a flag is set). - // This value will be reset in AshTestHelper::TearDown, most test fixtures - // don't need to care its lifecycle. - static void SetInitialLoginStatus(user::LoginStatus login_status); - - // Changes the current login status in the test. This also invokes - // UpdateAfterLoginStatusChange(). Usually this is called in the test code to - // set up a login status. This will fit to most of the test cases, but this - // cannot be set during the initialization. To test the initialization, - // consider using SetInitialLoginStatus() instead. - void SetLoginStatus(user::LoginStatus login_status); - - void set_should_show_display_notification(bool should_show) { - should_show_display_notification_ = should_show; - } - - // Overridden from SystemTrayDelegate: - virtual user::LoginStatus GetUserLoginStatus() const OVERRIDE; - virtual bool ShouldShowDisplayNotification() OVERRIDE; - virtual void ShutDown() OVERRIDE; - virtual void SignOut() OVERRIDE; - - private: - bool should_show_display_notification_; - user::LoginStatus login_status_; - - DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate); -}; - -} // namespace test -} // namespace ash - -#endif // ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ |