OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" | 5 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/apps/app_shim/app_shim_host_mac.h" | 10 #include "chrome/browser/apps/app_shim/app_shim_host_mac.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 FakeHost(const base::FilePath& profile_path, | 109 FakeHost(const base::FilePath& profile_path, |
110 const std::string& app_id, | 110 const std::string& app_id, |
111 TestingExtensionAppShimHandler* handler) | 111 TestingExtensionAppShimHandler* handler) |
112 : profile_path_(profile_path), | 112 : profile_path_(profile_path), |
113 app_id_(app_id), | 113 app_id_(app_id), |
114 handler_(handler), | 114 handler_(handler), |
115 close_count_(0) {} | 115 close_count_(0) {} |
116 | 116 |
117 MOCK_METHOD1(OnAppLaunchComplete, void(AppShimLaunchResult)); | 117 MOCK_METHOD1(OnAppLaunchComplete, void(AppShimLaunchResult)); |
118 | 118 |
119 virtual void OnAppClosed() OVERRIDE { | 119 virtual void OnAppClosed() override { |
120 handler_->OnShimClose(this); | 120 handler_->OnShimClose(this); |
121 ++close_count_; | 121 ++close_count_; |
122 } | 122 } |
123 virtual void OnAppHide() OVERRIDE {} | 123 virtual void OnAppHide() override {} |
124 virtual void OnAppRequestUserAttention(AppShimAttentionType type) OVERRIDE {} | 124 virtual void OnAppRequestUserAttention(AppShimAttentionType type) override {} |
125 virtual base::FilePath GetProfilePath() const OVERRIDE { | 125 virtual base::FilePath GetProfilePath() const override { |
126 return profile_path_; | 126 return profile_path_; |
127 } | 127 } |
128 virtual std::string GetAppId() const OVERRIDE { return app_id_; } | 128 virtual std::string GetAppId() const override { return app_id_; } |
129 | 129 |
130 int close_count() { return close_count_; } | 130 int close_count() { return close_count_; } |
131 | 131 |
132 private: | 132 private: |
133 base::FilePath profile_path_; | 133 base::FilePath profile_path_; |
134 std::string app_id_; | 134 std::string app_id_; |
135 TestingExtensionAppShimHandler* handler_; | 135 TestingExtensionAppShimHandler* handler_; |
136 int close_count_; | 136 int close_count_; |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(FakeHost); | 138 DISALLOW_COPY_AND_ASSIGN(FakeHost); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 .WillRepeatedly(Return(&profile_a_)); | 387 .WillRepeatedly(Return(&profile_a_)); |
388 EXPECT_CALL(*delegate_, LoadProfileAsync(profile_path_a_, _)) | 388 EXPECT_CALL(*delegate_, LoadProfileAsync(profile_path_a_, _)) |
389 .WillOnce(Invoke(delegate_, &MockDelegate::CaptureLoadProfileCallback)); | 389 .WillOnce(Invoke(delegate_, &MockDelegate::CaptureLoadProfileCallback)); |
390 NormalLaunch(&host_aa_); | 390 NormalLaunch(&host_aa_); |
391 EXPECT_FALSE(handler_->FindHost(&profile_a_, kTestAppIdA)); | 391 EXPECT_FALSE(handler_->FindHost(&profile_a_, kTestAppIdA)); |
392 delegate_->RunLoadProfileCallback(profile_path_a_, &profile_a_); | 392 delegate_->RunLoadProfileCallback(profile_path_a_, &profile_a_); |
393 EXPECT_TRUE(handler_->FindHost(&profile_a_, kTestAppIdA)); | 393 EXPECT_TRUE(handler_->FindHost(&profile_a_, kTestAppIdA)); |
394 } | 394 } |
395 | 395 |
396 } // namespace apps | 396 } // namespace apps |
OLD | NEW |