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/public/activity_factory.h" | 5 #include "athena/activity/public/activity_factory.h" |
6 #include "athena/activity/public/activity_manager.h" | 6 #include "athena/activity/public/activity_manager.h" |
7 #include "athena/content/app_activity.h" | |
8 #include "athena/content/app_activity_registry.h" | 7 #include "athena/content/app_activity_registry.h" |
9 #include "athena/content/public/app_content_control_delegate.h" | 8 #include "athena/content/public/app_content_control_delegate.h" |
10 #include "athena/content/public/app_registry.h" | 9 #include "athena/content/public/app_registry.h" |
10 #include "athena/content/shell/shell_app_activity.h" | |
11 #include "athena/test/athena_test_base.h" | 11 #include "athena/test/athena_test_base.h" |
12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 | 15 |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class BrowserContext; | 18 class BrowserContext; |
19 } | 19 } |
20 | 20 |
21 namespace athena { | 21 namespace athena { |
22 namespace test { | 22 namespace test { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // An identifier for the running apps. | 26 // An identifier for the running apps. |
27 const char kDummyApp1[] = "aaaaaaa"; | 27 const char kDummyApp1[] = "aaaaaaa"; |
28 const char kDummyApp2[] = "bbbbbbb"; | 28 const char kDummyApp2[] = "bbbbbbb"; |
29 | 29 |
30 // A dummy test app activity which works without content / ShellAppWindow. | 30 // A dummy test app activity which works without content / ShellAppWindow. |
31 class TestAppActivity : public AppActivity { | 31 class TestAppActivity : public ShellAppActivity { |
Jun Mukai
2014/08/26 21:28:23
Instead of depending ShellAppActivity, why not:
-
oshima
2014/08/26 21:43:27
That's better, thanks. Done.
| |
32 public: | 32 public: |
33 explicit TestAppActivity(const std::string& app_id) : | 33 explicit TestAppActivity(const std::string& app_id) : |
34 AppActivity(NULL), | 34 ShellAppActivity(NULL), |
35 app_id_(app_id), | 35 app_id_(app_id), |
36 view_(new views::View()), | 36 view_(new views::View()), |
37 current_state_(ACTIVITY_VISIBLE) { | 37 current_state_(ACTIVITY_VISIBLE) { |
38 app_activity_registry_ = | 38 app_activity_registry_ = |
39 AppRegistry::Get()->GetAppActivityRegistry(app_id, NULL); | 39 AppRegistry::Get()->GetAppActivityRegistry(app_id, NULL); |
40 app_activity_registry_->RegisterAppActivity(this); | 40 app_activity_registry_->RegisterAppActivity(this); |
41 } | 41 } |
42 virtual ~TestAppActivity() { | 42 virtual ~TestAppActivity() { |
43 app_activity_registry_->UnregisterAppActivity(this); | 43 app_activity_registry_->UnregisterAppActivity(this); |
44 } | 44 } |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 activity_proxy->SetCurrentState(Activity::ACTIVITY_VISIBLE); | 402 activity_proxy->SetCurrentState(Activity::ACTIVITY_VISIBLE); |
403 EXPECT_EQ(1, test_app_content_control_delegate()->restart_called()); | 403 EXPECT_EQ(1, test_app_content_control_delegate()->restart_called()); |
404 | 404 |
405 // However - the restart in this test framework does not really restart and | 405 // However - the restart in this test framework does not really restart and |
406 // all objects should be gone now. | 406 // all objects should be gone now. |
407 EXPECT_EQ(0, AppRegistry::Get()->NumberOfApplications()); | 407 EXPECT_EQ(0, AppRegistry::Get()->NumberOfApplications()); |
408 } | 408 } |
409 | 409 |
410 } // namespace test | 410 } // namespace test |
411 } // namespace athena | 411 } // namespace athena |
OLD | NEW |