OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/test/webdriver/commands/set_timeout_commands.h" | 10 #include "chrome/test/webdriver/commands/set_timeout_commands.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 path_segments.push_back("timeouts"); | 61 path_segments.push_back("timeouts"); |
62 path_segments.push_back("implicitly_wait"); | 62 path_segments.push_back("implicitly_wait"); |
63 | 63 |
64 DictionaryValue* parameters = new DictionaryValue; // Owned by |command|. | 64 DictionaryValue* parameters = new DictionaryValue; // Owned by |command|. |
65 ImplicitWaitCommand command(path_segments, parameters); | 65 ImplicitWaitCommand command(path_segments, parameters); |
66 | 66 |
67 AssertIsAbleToInitialize(&command); | 67 AssertIsAbleToInitialize(&command); |
68 | 68 |
69 AssertError(kBadRequest, "Request missing ms parameter", &command); | 69 AssertError(kBadRequest, "Request missing ms parameter", &command); |
70 | 70 |
71 parameters->Set("ms", Value::CreateNullValue()); | 71 parameters->Set("ms", base::NullValue()); |
72 AssertError(kBadRequest, "ms parameter is not a number", &command); | 72 AssertError(kBadRequest, "ms parameter is not a number", &command); |
73 | 73 |
74 parameters->SetString("ms", "apples"); | 74 parameters->SetString("ms", "apples"); |
75 AssertError(kBadRequest, "ms parameter is not a number", &command); | 75 AssertError(kBadRequest, "ms parameter is not a number", &command); |
76 | 76 |
77 parameters->SetInteger("ms", -1); | 77 parameters->SetInteger("ms", -1); |
78 AssertError(kBadRequest, "timeout must be non-negative: -1", &command); | 78 AssertError(kBadRequest, "timeout must be non-negative: -1", &command); |
79 | 79 |
80 parameters->SetDouble("ms", -3.0); | 80 parameters->SetDouble("ms", -3.0); |
81 AssertError(kBadRequest, "timeout must be non-negative: -3", &command); | 81 AssertError(kBadRequest, "timeout must be non-negative: -3", &command); |
82 | 82 |
83 parameters->SetInteger("ms", 1); | 83 parameters->SetInteger("ms", 1); |
84 AssertTimeoutSet(test_session, 1, &command); | 84 AssertTimeoutSet(test_session, 1, &command); |
85 parameters->SetDouble("ms", 2.5); | 85 parameters->SetDouble("ms", 2.5); |
86 AssertTimeoutSet(test_session, 2, &command); | 86 AssertTimeoutSet(test_session, 2, &command); |
87 parameters->SetInteger("ms", 0); | 87 parameters->SetInteger("ms", 0); |
88 AssertTimeoutSet(test_session, 0, &command); | 88 AssertTimeoutSet(test_session, 0, &command); |
89 } | 89 } |
90 | 90 |
91 } // namespace webdriver | 91 } // namespace webdriver |
OLD | NEW |