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 #ifndef MEDIA_CAST_TEST_UTILITY_INPUT_BUILDER_ | 5 #ifndef MEDIA_CAST_TEST_UTILITY_INPUT_BUILDER_ |
6 #define MEDIA_CAST_TEST_UTILITY_INPUT_BUILDER_ | 6 #define MEDIA_CAST_TEST_UTILITY_INPUT_BUILDER_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Ask the user for input, reads input from the input source and returns | 26 // Ask the user for input, reads input from the input source and returns |
27 // the answer. This method will keep asking the user until a correct answer | 27 // the answer. This method will keep asking the user until a correct answer |
28 // is returned and is thereby guaranteed to return a response that is | 28 // is returned and is thereby guaranteed to return a response that is |
29 // acceptable within the predefined range. | 29 // acceptable within the predefined range. |
30 // Input will be returned in either string or int format, base on the function | 30 // Input will be returned in either string or int format, base on the function |
31 // called. | 31 // called. |
32 std::string GetStringInput() const; | 32 std::string GetStringInput() const; |
33 int GetIntInput() const; | 33 int GetIntInput() const; |
34 | 34 |
35 private: | 35 private: |
36 bool ValidateInput(const std::string input) const; | 36 bool ValidateInput(const std::string& input) const; |
37 | 37 |
38 const std::string title_; | 38 const std::string title_; |
39 const std::string default_value_; | 39 const std::string default_value_; |
40 // Low and high range values for input validation. | 40 // Low and high range values for input validation. |
41 const int low_range_; | 41 const int low_range_; |
42 const int high_range_; | 42 const int high_range_; |
43 }; | 43 }; |
44 | 44 |
45 } // namespace test | 45 } // namespace test |
46 } // namespace cast | 46 } // namespace cast |
47 } // namespace media | 47 } // namespace media |
48 | 48 |
49 #endif // MEDIA_CAST_TEST_UTILITY_INPUT_BUILDER_ | 49 #endif // MEDIA_CAST_TEST_UTILITY_INPUT_BUILDER_ |
OLD | NEW |