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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void FakeAppInstance::SendRefreshAppList(const std::vector<AppInfo>& apps) { | 50 void FakeAppInstance::SendRefreshAppList(const std::vector<AppInfo>& apps) { |
51 app_host_->OnAppListRefreshed(mojo::Array<AppInfoPtr>::From(apps)); | 51 app_host_->OnAppListRefreshed(mojo::Array<AppInfoPtr>::From(apps)); |
52 } | 52 } |
53 | 53 |
54 bool FakeAppInstance::GenerateAndSendIcon(const AppInfo& app, | 54 bool FakeAppInstance::GenerateAndSendIcon(const AppInfo& app, |
55 ScaleFactor scale_factor, | 55 ScaleFactor scale_factor, |
56 std::string* png_data_as_string) { | 56 std::string* png_data_as_string) { |
57 CHECK(png_data_as_string != nullptr); | 57 CHECK(png_data_as_string != nullptr); |
58 std::string icon_file_name; | 58 std::string icon_file_name; |
59 switch (scale_factor) { | 59 switch (scale_factor) { |
60 case SCALE_FACTOR_SCALE_FACTOR_100P: | 60 case ScaleFactor::SCALE_FACTOR_100P: |
61 icon_file_name = "icon_100p.png"; | 61 icon_file_name = "icon_100p.png"; |
62 break; | 62 break; |
63 case SCALE_FACTOR_SCALE_FACTOR_125P: | 63 case ScaleFactor::SCALE_FACTOR_125P: |
64 icon_file_name = "icon_125p.png"; | 64 icon_file_name = "icon_125p.png"; |
65 break; | 65 break; |
66 case SCALE_FACTOR_SCALE_FACTOR_133P: | 66 case ScaleFactor::SCALE_FACTOR_133P: |
67 icon_file_name = "icon_133p.png"; | 67 icon_file_name = "icon_133p.png"; |
68 break; | 68 break; |
69 case SCALE_FACTOR_SCALE_FACTOR_140P: | 69 case ScaleFactor::SCALE_FACTOR_140P: |
70 icon_file_name = "icon_140p.png"; | 70 icon_file_name = "icon_140p.png"; |
71 break; | 71 break; |
72 case SCALE_FACTOR_SCALE_FACTOR_150P: | 72 case ScaleFactor::SCALE_FACTOR_150P: |
73 icon_file_name = "icon_150p.png"; | 73 icon_file_name = "icon_150p.png"; |
74 break; | 74 break; |
75 case SCALE_FACTOR_SCALE_FACTOR_180P: | 75 case ScaleFactor::SCALE_FACTOR_180P: |
76 icon_file_name = "icon_180p.png"; | 76 icon_file_name = "icon_180p.png"; |
77 break; | 77 break; |
78 case SCALE_FACTOR_SCALE_FACTOR_200P: | 78 case ScaleFactor::SCALE_FACTOR_200P: |
79 icon_file_name = "icon_200p.png"; | 79 icon_file_name = "icon_200p.png"; |
80 break; | 80 break; |
81 case SCALE_FACTOR_SCALE_FACTOR_250P: | 81 case ScaleFactor::SCALE_FACTOR_250P: |
82 icon_file_name = "icon_250p.png"; | 82 icon_file_name = "icon_250p.png"; |
83 break; | 83 break; |
84 case SCALE_FACTOR_SCALE_FACTOR_300P: | 84 case ScaleFactor::SCALE_FACTOR_300P: |
85 icon_file_name = "icon_300p.png"; | 85 icon_file_name = "icon_300p.png"; |
86 break; | 86 break; |
87 default: | 87 default: |
88 NOTREACHED(); | 88 NOTREACHED(); |
89 return false; | 89 return false; |
90 } | 90 } |
91 | 91 |
92 base::FilePath base_path; | 92 base::FilePath base_path; |
93 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &base_path)); | 93 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &base_path)); |
94 base::FilePath icon_file_path = base_path.AppendASCII("components") | 94 base::FilePath icon_file_path = base_path.AppendASCII("components") |
(...skipping 23 matching lines...) Expand all Loading... |
118 // (and when running under Valgrind), the two thread hops needed to send and | 118 // (and when running under Valgrind), the two thread hops needed to send and |
119 // dispatch each Mojo message might not be picked up by a single | 119 // dispatch each Mojo message might not be picked up by a single |
120 // RunUntilIdle(), so keep pumping the message loop until all expected | 120 // RunUntilIdle(), so keep pumping the message loop until all expected |
121 // messages are. | 121 // messages are. |
122 while (refresh_app_list_count_ != 1) { | 122 while (refresh_app_list_count_ != 1) { |
123 base::RunLoop().RunUntilIdle(); | 123 base::RunLoop().RunUntilIdle(); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 } // namespace arc | 127 } // namespace arc |
OLD | NEW |