Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / athena / activity / activity_manager_unittest.cc
blob4374609fa9ad6f1b5f30348d8e26170c570226e2
1 /// Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "athena/activity/activity_manager_impl.h"
7 #include "athena/activity/public/activity.h"
8 #include "athena/activity/public/activity_factory.h"
9 #include "athena/test/athena_test_base.h"
10 #include "ui/aura/window.h"
12 namespace athena {
14 typedef test::AthenaTestBase ActivityManagerTest;
16 TEST_F(ActivityManagerTest, Basic) {
17 ActivityManagerImpl* activity_manager =
18 static_cast<ActivityManagerImpl*>(ActivityManager::Get());
19 scoped_ptr<Activity> activity1(
20 athena::ActivityFactory::Get()->CreateWebActivity(NULL, GURL()));
21 activity_manager->AddActivity(activity1.get());
22 EXPECT_EQ(1, activity_manager->num_activities());
24 Activity* activity2 =
25 athena::ActivityFactory::Get()->CreateWebActivity(NULL, GURL());
26 activity_manager->AddActivity(activity2);
27 EXPECT_EQ(2, activity_manager->num_activities());
29 activity1.reset();
30 EXPECT_EQ(1, activity_manager->num_activities());
32 // Deleting the activity's window should delete the activity itself.
33 delete activity2->GetWindow();
34 EXPECT_EQ(0, activity_manager->num_activities());
37 } // namespace athena