Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: chrome/test/webdriver/webdriver_session.h

Issue 8890026: Allow chromedriver to set local state preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ 5 #ifndef CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_
6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ 6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Options(); 55 Options();
56 ~Options(); 56 ~Options();
57 57
58 // True if the session should simulate OS-level input. Currently only 58 // True if the session should simulate OS-level input. Currently only
59 // applies to keyboard input. 59 // applies to keyboard input.
60 bool use_native_events; 60 bool use_native_events;
61 61
62 // True if the session should not wait for page loads and navigate 62 // True if the session should not wait for page loads and navigate
63 // asynchronously. 63 // asynchronously.
64 bool load_async; 64 bool load_async;
65
66 // By default, ChromeDriver configures Chrome in such a way as convenient
67 // for website testing. E.g., it configures Chrome so that sites are allowed
68 // to use the geolocation API without requesting the user's consent.
69 // If this is set to true, ChromeDriver will not modify Chrome's default
70 // behavior.
71 bool no_website_testing_defaults;
72
73 // A list of extensions to install on startup.
74 std::vector<FilePath> extensions;
65 }; 75 };
66 76
67 // Adds this |Session| to the |SessionManager|. The session manages its own 77 // Adds this |Session| to the |SessionManager|. The session manages its own
68 // lifetime. Do not call delete. 78 // lifetime. Do not call delete.
69 explicit Session(const Options& options); 79 explicit Session(const Options& options);
70 80
71 // Removes this |Session| from the |SessionManager|. 81 // Removes this |Session| from the |SessionManager|.
72 ~Session(); 82 ~Session();
73 83
74 // Starts the session thread and a new browser, using the exe found at 84 // Starts the session thread and a new browser, using the exe found at
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 bool* is_visible); 333 bool* is_visible);
324 334
325 Error* SetExtensionState(const std::string& extension_id, 335 Error* SetExtensionState(const std::string& extension_id,
326 bool enable); 336 bool enable);
327 337
328 Error* ClickExtensionButton(const std::string& extension_id, 338 Error* ClickExtensionButton(const std::string& extension_id,
329 bool browser_action); 339 bool browser_action);
330 340
331 Error* UninstallExtension(const std::string& extension_id); 341 Error* UninstallExtension(const std::string& extension_id);
332 342
343 // Sets the preference to the given value. This function takes ownership
344 // of |value|. If the preference is a user preference (instead of local
345 // state preference) |is_user_pref| should be true.
346 Error* SetPreference(const std::string& pref,
347 bool is_user_pref,
348 base::Value* value);
349
333 const std::string& id() const; 350 const std::string& id() const;
334 351
335 const FrameId& current_target() const; 352 const FrameId& current_target() const;
336 353
337 void set_async_script_timeout(int timeout_ms); 354 void set_async_script_timeout(int timeout_ms);
338 int async_script_timeout() const; 355 int async_script_timeout() const;
339 356
340 void set_implicit_wait(int timeout_ms); 357 void set_implicit_wait(int timeout_ms);
341 int implicit_wait() const; 358 int implicit_wait() const;
342 359
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 const FrameId& frame_id, 408 const FrameId& frame_id,
392 const ElementId& element, 409 const ElementId& element,
393 const Point& location); 410 const Point& location);
394 Error* GetElementRegionInViewHelper( 411 Error* GetElementRegionInViewHelper(
395 const FrameId& frame_id, 412 const FrameId& frame_id,
396 const ElementId& element, 413 const ElementId& element,
397 const Rect& region, 414 const Rect& region,
398 bool center, 415 bool center,
399 bool verify_clickable_at_middle, 416 bool verify_clickable_at_middle,
400 Point* location); 417 Point* location);
418 Error* PostBrowserStartInit();
419 Error* InitForWebsiteTesting();
401 420
402 const std::string id_; 421 const std::string id_;
403 FrameId current_target_; 422 FrameId current_target_;
404 423
405 scoped_ptr<Automation> automation_; 424 scoped_ptr<Automation> automation_;
406 base::Thread thread_; 425 base::Thread thread_;
407 426
408 // Timeout (in ms) for asynchronous script execution. 427 // Timeout (in ms) for asynchronous script execution.
409 int async_script_timeout_; 428 int async_script_timeout_;
410 429
(...skipping 19 matching lines...) Expand all
430 Options options_; 449 Options options_;
431 450
432 DISALLOW_COPY_AND_ASSIGN(Session); 451 DISALLOW_COPY_AND_ASSIGN(Session);
433 }; 452 };
434 453
435 } // namespace webdriver 454 } // namespace webdriver
436 455
437 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); 456 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session);
438 457
439 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ 458 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_capabilities_parser.cc ('k') | chrome/test/webdriver/webdriver_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698