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

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

Issue 24086003: [chromedriver] Don't overwrite extension snapshot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | 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 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 const base::DictionaryValue& params, 732 const base::DictionaryValue& params,
733 scoped_ptr<base::Value>* value) { 733 scoped_ptr<base::Value>* value) {
734 Status status = session->chrome->ActivateWebView(web_view->GetId()); 734 Status status = session->chrome->ActivateWebView(web_view->GetId());
735 if (status.IsError()) 735 if (status.IsError())
736 return status; 736 return status;
737 737
738 std::string screenshot; 738 std::string screenshot;
739 if (session->chrome->GetType() == Chrome::DESKTOP && 739 if (session->chrome->GetType() == Chrome::DESKTOP &&
740 !session->force_devtools_screenshot) { 740 !session->force_devtools_screenshot) {
741 AutomationExtension* extension = NULL; 741 AutomationExtension* extension = NULL;
742 Status status = session->chrome->GetAutomationExtension(&extension); 742 status = session->chrome->GetAutomationExtension(&extension);
743 if (status.IsError()) 743 if (status.IsError())
744 return status; 744 return status;
745 status = extension->CaptureScreenshot(&screenshot); 745 status = extension->CaptureScreenshot(&screenshot);
746 // If the screenshot was forbidden, fallback to DevTools. 746 // If the screenshot was forbidden, fallback to DevTools.
747 if (status.code() != kForbidden) 747 if (status.code() == kForbidden)
748 return status; 748 status = web_view->CaptureScreenshot(&screenshot);
749 } else {
750 status = web_view->CaptureScreenshot(&screenshot);
749 } 751 }
750
751 status = web_view->CaptureScreenshot(&screenshot);
752 if (status.IsError()) 752 if (status.IsError())
753 return status; 753 return status;
754 754
755 value->reset(new base::StringValue(screenshot)); 755 value->reset(new base::StringValue(screenshot));
756 return Status(kOk); 756 return Status(kOk);
757 } 757 }
758 758
759 Status ExecuteGetCookies( 759 Status ExecuteGetCookies(
760 Session* session, 760 Session* session,
761 WebView* web_view, 761 WebView* web_view,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 // |accuracy| is not part of the WebDriver spec yet, so if it is not given 852 // |accuracy| is not part of the WebDriver spec yet, so if it is not given
853 // default to 100 meters accuracy. 853 // default to 100 meters accuracy.
854 geoposition.accuracy = 100; 854 geoposition.accuracy = 100;
855 } 855 }
856 856
857 Status status = web_view->OverrideGeolocation(geoposition); 857 Status status = web_view->OverrideGeolocation(geoposition);
858 if (status.IsOk()) 858 if (status.IsOk())
859 session->overridden_geoposition.reset(new Geoposition(geoposition)); 859 session->overridden_geoposition.reset(new Geoposition(geoposition));
860 return status; 860 return status;
861 } 861 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698