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

Side by Side Diff: chrome/test/chromedriver/window_commands.cc

Issue 12321057: [chromedriver] Implement reconnection to DevTools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 7 years, 9 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/chromedriver/web_view_impl_unittest.cc ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromedriver/window_commands.h" 5 #include "chrome/test/chromedriver/window_commands.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 if (status.IsError()) 45 if (status.IsError())
46 return status; 46 return status;
47 if (is_dialog_open) 47 if (is_dialog_open)
48 return Status(kUnexpectedAlertOpen); 48 return Status(kUnexpectedAlertOpen);
49 49
50 WebView* web_view = NULL; 50 WebView* web_view = NULL;
51 status = session->GetTargetWindow(&web_view); 51 status = session->GetTargetWindow(&web_view);
52 if (status.IsError()) 52 if (status.IsError())
53 return status; 53 return status;
54 54
55 status = web_view->ConnectIfNecessary();
56 if (status.IsError())
57 return status;
58
55 Status nav_status = web_view->WaitForPendingNavigations(session->frame); 59 Status nav_status = web_view->WaitForPendingNavigations(session->frame);
56 if (nav_status.IsError()) 60 if (nav_status.IsError())
57 return nav_status; 61 return nav_status;
58 status = command.Run(session, web_view, params, value); 62 status = command.Run(session, web_view, params, value);
59 // Switch to main frame and retry command if subframe no longer exists. 63 // Switch to main frame and retry command if subframe no longer exists.
60 if (status.code() == kNoSuchFrame) { 64 if (status.code() == kNoSuchFrame) {
61 session->frame = ""; 65 session->frame = "";
62 nav_status = web_view->WaitForPendingNavigations(session->frame); 66 nav_status = web_view->WaitForPendingNavigations(session->frame);
63 if (nav_status.IsError()) 67 if (nav_status.IsError())
64 return nav_status; 68 return nav_status;
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 WebView* web_view, 486 WebView* web_view,
483 const base::DictionaryValue& params, 487 const base::DictionaryValue& params,
484 scoped_ptr<base::Value>* value) { 488 scoped_ptr<base::Value>* value) {
485 std::string screenshot; 489 std::string screenshot;
486 Status status = web_view->CaptureScreenshot(&screenshot); 490 Status status = web_view->CaptureScreenshot(&screenshot);
487 if (status.IsError()) 491 if (status.IsError())
488 return status; 492 return status;
489 value->reset(new base::StringValue(screenshot)); 493 value->reset(new base::StringValue(screenshot));
490 return Status(kOk); 494 return Status(kOk);
491 } 495 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/web_view_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698