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/response.h" | 10 #include "chrome/test/webdriver/commands/response.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ASSERT_EQ(expected_timeout, test_session.implicit_wait()); | 48 ASSERT_EQ(expected_timeout, test_session.implicit_wait()); |
49 } | 49 } |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 TEST(ImplicitWaitCommandTest, SettingImplicitWaits) { | 53 TEST(ImplicitWaitCommandTest, SettingImplicitWaits) { |
54 Session test_session; | 54 Session test_session; |
55 ASSERT_EQ(0, test_session.implicit_wait()) << "Sanity check failed"; | 55 ASSERT_EQ(0, test_session.implicit_wait()) << "Sanity check failed"; |
56 | 56 |
57 std::vector<std::string> path_segments; | 57 std::vector<std::string> path_segments; |
58 path_segments.push_back(""); | 58 path_segments.push_back(std::string()); |
59 path_segments.push_back("session"); | 59 path_segments.push_back("session"); |
60 path_segments.push_back(test_session.id()); | 60 path_segments.push_back(test_session.id()); |
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 base::DictionaryValue* parameters = | 64 base::DictionaryValue* parameters = |
65 new base::DictionaryValue; // Owned by |command|. | 65 new base::DictionaryValue; // Owned by |command|. |
66 ImplicitWaitCommand command(path_segments, parameters); | 66 ImplicitWaitCommand command(path_segments, parameters); |
67 | 67 |
68 AssertIsAbleToInitialize(&command); | 68 AssertIsAbleToInitialize(&command); |
(...skipping 14 matching lines...) Expand all Loading... |
83 | 83 |
84 parameters->SetInteger("ms", 1); | 84 parameters->SetInteger("ms", 1); |
85 AssertTimeoutSet(test_session, 1, &command); | 85 AssertTimeoutSet(test_session, 1, &command); |
86 parameters->SetDouble("ms", 2.5); | 86 parameters->SetDouble("ms", 2.5); |
87 AssertTimeoutSet(test_session, 2, &command); | 87 AssertTimeoutSet(test_session, 2, &command); |
88 parameters->SetInteger("ms", 0); | 88 parameters->SetInteger("ms", 0); |
89 AssertTimeoutSet(test_session, 0, &command); | 89 AssertTimeoutSet(test_session, 0, &command); |
90 } | 90 } |
91 | 91 |
92 } // namespace webdriver | 92 } // namespace webdriver |
OLD | NEW |