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

Side by Side Diff: chrome/test/webdriver/commands/webdriver_command.cc

Issue 7582005: Add chrome.loadAsync capability to ChromeDriver, which allows the user not to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac Created 9 years, 4 months 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 #include "chrome/test/webdriver/commands/webdriver_command.h" 5 #include "chrome/test/webdriver/commands/webdriver_command.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 23 matching lines...) Expand all
34 return false; 34 return false;
35 } 35 }
36 36
37 session_ = SessionManager::GetInstance()->GetSession(session_id); 37 session_ = SessionManager::GetInstance()->GetSession(session_id);
38 if (session_ == NULL) { 38 if (session_ == NULL) {
39 response->SetError( 39 response->SetError(
40 new Error(kSessionNotFound, "Session not found: " + session_id)); 40 new Error(kSessionNotFound, "Session not found: " + session_id));
41 return false; 41 return false;
42 } 42 }
43 43
44 LOG(INFO) << "Waiting for the page to stop loading"; 44 Error* error = session_->BeforeExecuteCommand();
45 Error* error = session_->WaitForAllTabsToStopLoading();
46 if (error) { 45 if (error) {
47 response->SetError(error); 46 response->SetError(error);
48 return false; 47 return false;
49 } 48 }
50 LOG(INFO) << "Done waiting for the page to stop loading";
51 error = session_->SwitchToTopFrameIfCurrentFrameInvalid();
52 if (error) {
53 response->SetError(error);
54 return false;
55 }
56
57 response->SetField("sessionId", Value::CreateStringValue(session_id)); 49 response->SetField("sessionId", Value::CreateStringValue(session_id));
58 return true; 50 return true;
59 } 51 }
60 52
61 } // namespace webdriver 53 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/set_timeout_commands_unittest.cc ('k') | chrome/test/webdriver/session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698