OLD | NEW |
1 /// Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "athena/activity/activity_manager_impl.h" | 5 #include "athena/activity/activity_manager_impl.h" |
6 | 6 |
7 #include "athena/activity/public/activity.h" | 7 #include "athena/activity/public/activity.h" |
8 #include "athena/activity/public/activity_factory.h" | 8 #include "athena/activity/public/activity_factory.h" |
9 #include "athena/test/base/athena_test_base.h" | 9 #include "athena/test/base/athena_test_base.h" |
| 10 #include "athena/test/base/test_windows.h" |
10 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
11 | 12 |
12 namespace athena { | 13 namespace athena { |
13 | 14 |
14 typedef test::AthenaTestBase ActivityManagerTest; | 15 typedef test::AthenaTestBase ActivityManagerTest; |
15 | 16 |
16 TEST_F(ActivityManagerTest, Basic) { | 17 TEST_F(ActivityManagerTest, Basic) { |
17 ActivityManagerImpl* activity_manager = | 18 ActivityManagerImpl* activity_manager = |
18 static_cast<ActivityManagerImpl*>(ActivityManager::Get()); | 19 static_cast<ActivityManagerImpl*>(ActivityManager::Get()); |
19 ActivityFactory* factory = ActivityFactory::Get(); | 20 ActivityFactory* factory = ActivityFactory::Get(); |
(...skipping 26 matching lines...) Expand all Loading... |
46 Activity* activity1 = | 47 Activity* activity1 = |
47 factory->CreateWebActivity(NULL, base::string16(), GURL()); | 48 factory->CreateWebActivity(NULL, base::string16(), GURL()); |
48 Activity* activity2 = | 49 Activity* activity2 = |
49 factory->CreateWebActivity(NULL, base::string16(), GURL()); | 50 factory->CreateWebActivity(NULL, base::string16(), GURL()); |
50 | 51 |
51 EXPECT_EQ(activity1, manager->GetActivityForWindow(activity1->GetWindow())); | 52 EXPECT_EQ(activity1, manager->GetActivityForWindow(activity1->GetWindow())); |
52 EXPECT_EQ(activity2, manager->GetActivityForWindow(activity2->GetWindow())); | 53 EXPECT_EQ(activity2, manager->GetActivityForWindow(activity2->GetWindow())); |
53 | 54 |
54 EXPECT_EQ(NULL, manager->GetActivityForWindow(NULL)); | 55 EXPECT_EQ(NULL, manager->GetActivityForWindow(NULL)); |
55 | 56 |
56 scoped_ptr<aura::Window> window = CreateTestWindow(NULL, gfx::Rect()); | 57 scoped_ptr<aura::Window> window = test::CreateNormalWindow(NULL, NULL); |
57 EXPECT_EQ(NULL, manager->GetActivityForWindow(window.get())); | 58 EXPECT_EQ(NULL, manager->GetActivityForWindow(window.get())); |
58 } | 59 } |
59 | 60 |
60 } // namespace athena | 61 } // namespace athena |
OLD | NEW |