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

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

Issue 7648053: [chromedriver] Add chrome.detach option for configuring Chrome not to quit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile issue 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
« no previous file with comments | « chrome/test/webdriver/webdriver_session.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/webdriver_session.h" 5 #include "chrome/test/webdriver/webdriver_session.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 this, 86 this,
87 &Session::InitOnSessionThread, 87 &Session::InitOnSessionThread,
88 options, 88 options,
89 &error)); 89 &error));
90 if (error) 90 if (error)
91 Terminate(); 91 Terminate();
92 return error; 92 return error;
93 } 93 }
94 94
95 Error* Session::BeforeExecuteCommand() { 95 Error* Session::BeforeExecuteCommand() {
96 Error* error = AfterExecuteCommand();
97 if (!error) {
98 scoped_ptr<Error> switch_error(SwitchToTopFrameIfCurrentFrameInvalid());
99 if (switch_error.get()) {
100 std::string text;
101 scoped_ptr<Error> alert_error(GetAlertMessage(&text));
102 if (alert_error.get()) {
103 // Only return a frame checking error if a modal dialog is not present.
104 // TODO(kkania): This is ugly. Fix.
105 return switch_error.release();
106 }
107 }
108 }
109 return error;
110 }
111
112 Error* Session::AfterExecuteCommand() {
96 Error* error = NULL; 113 Error* error = NULL;
97 if (!options_.load_async) { 114 if (!options_.load_async) {
98 LOG(INFO) << "Waiting for the page to stop loading"; 115 LOG(INFO) << "Waiting for the page to stop loading";
99 error = WaitForAllTabsToStopLoading(); 116 error = WaitForAllTabsToStopLoading();
100 LOG(INFO) << "Done waiting for the page to stop loading"; 117 LOG(INFO) << "Done waiting for the page to stop loading";
101 } 118 }
102 if (!error) {
103 error = SwitchToTopFrameIfCurrentFrameInvalid();
104 }
105 return error; 119 return error;
106 } 120 }
107 121
108 void Session::Terminate() { 122 void Session::Terminate() {
109 RunSessionTask(NewRunnableMethod( 123 RunSessionTask(NewRunnableMethod(
110 this, 124 this,
111 &Session::TerminateOnSessionThread)); 125 &Session::TerminateOnSessionThread));
112 delete this; 126 delete this;
113 } 127 }
114 128
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 Error* Session::GetAppCacheStatus(int* status) { 1400 Error* Session::GetAppCacheStatus(int* status) {
1387 return ExecuteScriptAndParse( 1401 return ExecuteScriptAndParse(
1388 current_target_, 1402 current_target_,
1389 atoms::GET_APPCACHE_STATUS, 1403 atoms::GET_APPCACHE_STATUS,
1390 "getAppcacheStatus", 1404 "getAppcacheStatus",
1391 new ListValue(), 1405 new ListValue(),
1392 CreateDirectValueParser(status)); 1406 CreateDirectValueParser(status));
1393 } 1407 }
1394 1408
1395 } // namespace webdriver 1409 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698