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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ImplicitWaitCommand* const command) { | 43 ImplicitWaitCommand* const command) { |
44 Response response; | 44 Response response; |
45 command->ExecutePost(&response); | 45 command->ExecutePost(&response); |
46 ASSERT_EQ(kSuccess, response.GetStatus()) << response.ToJSON(); | 46 ASSERT_EQ(kSuccess, response.GetStatus()) << response.ToJSON(); |
47 ASSERT_EQ(expected_timeout, test_session.implicit_wait()); | 47 ASSERT_EQ(expected_timeout, test_session.implicit_wait()); |
48 } | 48 } |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 TEST(ImplicitWaitCommandTest, SettingImplicitWaits) { | 52 TEST(ImplicitWaitCommandTest, SettingImplicitWaits) { |
53 Session test_session; | 53 Session::Options options = Session::Options(); |
| 54 Session test_session(options); |
54 ASSERT_EQ(0, test_session.implicit_wait()) << "Sanity check failed"; | 55 ASSERT_EQ(0, test_session.implicit_wait()) << "Sanity check failed"; |
55 | 56 |
56 std::vector<std::string> path_segments; | 57 std::vector<std::string> path_segments; |
57 path_segments.push_back(""); | 58 path_segments.push_back(""); |
58 path_segments.push_back("session"); | 59 path_segments.push_back("session"); |
59 path_segments.push_back(test_session.id()); | 60 path_segments.push_back(test_session.id()); |
60 path_segments.push_back("timeouts"); | 61 path_segments.push_back("timeouts"); |
61 path_segments.push_back("implicitly_wait"); | 62 path_segments.push_back("implicitly_wait"); |
62 | 63 |
63 DictionaryValue* parameters = new DictionaryValue; // Owned by |command|. | 64 DictionaryValue* parameters = new DictionaryValue; // Owned by |command|. |
(...skipping 17 matching lines...) Expand all Loading... |
81 | 82 |
82 parameters->SetInteger("ms", 1); | 83 parameters->SetInteger("ms", 1); |
83 AssertTimeoutSet(test_session, 1, &command); | 84 AssertTimeoutSet(test_session, 1, &command); |
84 parameters->SetDouble("ms", 2.5); | 85 parameters->SetDouble("ms", 2.5); |
85 AssertTimeoutSet(test_session, 2, &command); | 86 AssertTimeoutSet(test_session, 2, &command); |
86 parameters->SetInteger("ms", 0); | 87 parameters->SetInteger("ms", 0); |
87 AssertTimeoutSet(test_session, 0, &command); | 88 AssertTimeoutSet(test_session, 0, &command); |
88 } | 89 } |
89 | 90 |
90 } // namespace webdriver | 91 } // namespace webdriver |
OLD | NEW |