OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/arc/test/fake_app_instance.h" | 5 #include "components/arc/test/fake_app_instance.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void FakeAppInstance::SendRefreshAppList(const std::vector<AppInfo>& apps) { | 49 void FakeAppInstance::SendRefreshAppList(const std::vector<AppInfo>& apps) { |
50 app_host_->OnAppListRefreshed(mojo::Array<AppInfoPtr>::From(apps)); | 50 app_host_->OnAppListRefreshed(mojo::Array<AppInfoPtr>::From(apps)); |
51 } | 51 } |
52 | 52 |
53 bool FakeAppInstance::GenerateAndSendIcon(const AppInfo& app, | 53 bool FakeAppInstance::GenerateAndSendIcon(const AppInfo& app, |
54 ScaleFactor scale_factor, | 54 ScaleFactor scale_factor, |
55 std::string* png_data_as_string) { | 55 std::string* png_data_as_string) { |
56 CHECK(png_data_as_string != nullptr); | 56 CHECK(png_data_as_string != nullptr); |
57 std::string icon_file_name; | 57 std::string icon_file_name; |
58 switch (scale_factor) { | 58 switch (scale_factor) { |
59 case SCALE_FACTOR_SCALE_FACTOR_100P: | 59 case ScaleFactor::SCALE_FACTOR_100P: |
60 icon_file_name = "icon_100p.png"; | 60 icon_file_name = "icon_100p.png"; |
61 break; | 61 break; |
62 case SCALE_FACTOR_SCALE_FACTOR_125P: | 62 case ScaleFactor::SCALE_FACTOR_125P: |
63 icon_file_name = "icon_125p.png"; | 63 icon_file_name = "icon_125p.png"; |
64 break; | 64 break; |
65 case SCALE_FACTOR_SCALE_FACTOR_133P: | 65 case ScaleFactor::SCALE_FACTOR_133P: |
66 icon_file_name = "icon_133p.png"; | 66 icon_file_name = "icon_133p.png"; |
67 break; | 67 break; |
68 case SCALE_FACTOR_SCALE_FACTOR_140P: | 68 case ScaleFactor::SCALE_FACTOR_140P: |
69 icon_file_name = "icon_140p.png"; | 69 icon_file_name = "icon_140p.png"; |
70 break; | 70 break; |
71 case SCALE_FACTOR_SCALE_FACTOR_150P: | 71 case ScaleFactor::SCALE_FACTOR_150P: |
72 icon_file_name = "icon_150p.png"; | 72 icon_file_name = "icon_150p.png"; |
73 break; | 73 break; |
74 case SCALE_FACTOR_SCALE_FACTOR_180P: | 74 case ScaleFactor::SCALE_FACTOR_180P: |
75 icon_file_name = "icon_180p.png"; | 75 icon_file_name = "icon_180p.png"; |
76 break; | 76 break; |
77 case SCALE_FACTOR_SCALE_FACTOR_200P: | 77 case ScaleFactor::SCALE_FACTOR_200P: |
78 icon_file_name = "icon_200p.png"; | 78 icon_file_name = "icon_200p.png"; |
79 break; | 79 break; |
80 case SCALE_FACTOR_SCALE_FACTOR_250P: | 80 case ScaleFactor::SCALE_FACTOR_250P: |
81 icon_file_name = "icon_250p.png"; | 81 icon_file_name = "icon_250p.png"; |
82 break; | 82 break; |
83 case SCALE_FACTOR_SCALE_FACTOR_300P: | 83 case ScaleFactor::SCALE_FACTOR_300P: |
84 icon_file_name = "icon_300p.png"; | 84 icon_file_name = "icon_300p.png"; |
85 break; | 85 break; |
86 default: | 86 default: |
87 NOTREACHED(); | 87 NOTREACHED(); |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 base::FilePath base_path; | 91 base::FilePath base_path; |
92 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &base_path)); | 92 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &base_path)); |
93 base::FilePath icon_file_path = base_path.AppendASCII("components") | 93 base::FilePath icon_file_path = base_path.AppendASCII("components") |
(...skipping 13 matching lines...) Expand all Loading... |
107 void FakeAppInstance::WaitForIncomingMethodCall() { | 107 void FakeAppInstance::WaitForIncomingMethodCall() { |
108 binding_.WaitForIncomingMethodCall(); | 108 binding_.WaitForIncomingMethodCall(); |
109 } | 109 } |
110 | 110 |
111 void FakeAppInstance::WaitForOnAppInstanceReady() { | 111 void FakeAppInstance::WaitForOnAppInstanceReady() { |
112 WaitForIncomingMethodCall(); // Wait for Init(). | 112 WaitForIncomingMethodCall(); // Wait for Init(). |
113 WaitForIncomingMethodCall(); // Wait for RefreshAppList(). | 113 WaitForIncomingMethodCall(); // Wait for RefreshAppList(). |
114 } | 114 } |
115 | 115 |
116 } // namespace arc | 116 } // namespace arc |
OLD | NEW |