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 // To test, run "out/Debug//mojo_shell mojo:prediction_apptests" | 5 // To test, run "out/Debug//mojo_shell mojo:prediction_apptests" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
10 #include "mojo/public/cpp/application/application_test_base.h" | 10 #include "mojo/public/cpp/application/application_test_base.h" |
11 #include "mojo/services/prediction/public/interfaces/prediction.mojom.h" | 11 #include "mojo/services/prediction/interfaces/prediction.mojom.h" |
12 | 12 |
13 namespace prediction { | 13 namespace prediction { |
14 | 14 |
15 void GetPredictionListAndEnd(std::vector<std::string>* output_list, | 15 void GetPredictionListAndEnd(std::vector<std::string>* output_list, |
16 const mojo::Array<mojo::String>& input_list) { | 16 const mojo::Array<mojo::String>& input_list) { |
17 *output_list = input_list.To<std::vector<std::string>>(); | 17 *output_list = input_list.To<std::vector<std::string>>(); |
18 base::MessageLoop::current()->Quit(); | 18 base::MessageLoop::current()->Quit(); |
19 } | 19 } |
20 | 20 |
21 class PredictionApptest : public mojo::test::ApplicationTestBase { | 21 class PredictionApptest : public mojo::test::ApplicationTestBase { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 PrevWordInfoPtr prev_word = PrevWordInfo::New(); | 117 PrevWordInfoPtr prev_word = PrevWordInfo::New(); |
118 prev_word->word = "This"; | 118 prev_word->word = "This"; |
119 prev_word->is_beginning_of_sentence = true; | 119 prev_word->is_beginning_of_sentence = true; |
120 mojo::Array<PrevWordInfoPtr> prev_words = | 120 mojo::Array<PrevWordInfoPtr> prev_words = |
121 mojo::Array<PrevWordInfoPtr>::New(0); | 121 mojo::Array<PrevWordInfoPtr>::New(0); |
122 prev_words.push_back(prev_word.Pass()); | 122 prev_words.push_back(prev_word.Pass()); |
123 EXPECT_EQ((int)GetPredictionListClient(prev_words, "").size(), 0); | 123 EXPECT_EQ((int)GetPredictionListClient(prev_words, "").size(), 0); |
124 } | 124 } |
125 | 125 |
126 } // namespace prediction | 126 } // namespace prediction |
OLD | NEW |