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

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

Issue 2215153002: [DevTools] Eliminate frameId and isContentScript from js protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: navigation tracker Created 4 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
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/chrome/navigation_tracker.h" 5 #include "chrome/test/chromedriver/chrome/navigation_tracker.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/test/chromedriver/chrome/browser_info.h" 9 #include "chrome/test/chromedriver/chrome/browser_info.h"
10 #include "chrome/test/chromedriver/chrome/devtools_client.h" 10 #include "chrome/test/chromedriver/chrome/devtools_client.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // them. 322 // them.
323 ResetLoadingState(kLoading); 323 ResetLoadingState(kLoading);
324 } 324 }
325 } 325 }
326 } else if (method == "Runtime.executionContextCreated") { 326 } else if (method == "Runtime.executionContextCreated") {
327 if (!IsExpectingFrameLoadingEvents()) { 327 if (!IsExpectingFrameLoadingEvents()) {
328 int execution_context_id; 328 int execution_context_id;
329 if (!params.GetInteger("context.id", &execution_context_id)) 329 if (!params.GetInteger("context.id", &execution_context_id))
330 return Status(kUnknownError, "missing or invalid 'context.id'"); 330 return Status(kUnknownError, "missing or invalid 'context.id'");
331 std::string frame_id; 331 std::string frame_id;
332 if (!params.GetString("context.frameId", &frame_id)) 332 if (!params.GetString("context.auxData.frameId", &frame_id)) {
333 return Status(kUnknownError, "missing or invalid 'context.frameId'"); 333 // TODO(samuong): remove this when we stop supporting Chrome 53.
334 if (!params.GetString("context.frameId", &frame_id))
335 return Status(kUnknownError, "missing or invalid 'context.frameId'");
336 }
334 if (frame_id == dummy_frame_id_) 337 if (frame_id == dummy_frame_id_)
335 dummy_execution_context_id_ = execution_context_id; 338 dummy_execution_context_id_ = execution_context_id;
336 else 339 else
337 execution_context_set_.insert(execution_context_id); 340 execution_context_set_.insert(execution_context_id);
338 } 341 }
339 } else if (method == "Runtime.executionContextDestroyed") { 342 } else if (method == "Runtime.executionContextDestroyed") {
340 if (!IsExpectingFrameLoadingEvents()) { 343 if (!IsExpectingFrameLoadingEvents()) {
341 int execution_context_id; 344 int execution_context_id;
342 if (!params.GetInteger("executionContextId", &execution_context_id)) 345 if (!params.GetInteger("executionContextId", &execution_context_id))
343 return Status(kUnknownError, "missing or invalid 'context.id'"); 346 return Status(kUnknownError, "missing or invalid 'context.id'");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // modal dialogs. This pauses the render process so we need to be careful not 435 // modal dialogs. This pauses the render process so we need to be careful not
433 // to issue Runtime.evaluate commands while an alert is up, otherwise the call 436 // to issue Runtime.evaluate commands while an alert is up, otherwise the call
434 // will block and timeout. For details refer to 437 // will block and timeout. For details refer to
435 // https://bugs.chromium.org/p/chromedriver/issues/detail?id=1381. 438 // https://bugs.chromium.org/p/chromedriver/issues/detail?id=1381.
436 // TODO(samuong): Remove this once we stop supporting M51. 439 // TODO(samuong): Remove this once we stop supporting M51.
437 if (browser_info_->browser_name == "chrome") 440 if (browser_info_->browser_name == "chrome")
438 return browser_info_->build_no >= 2743; 441 return browser_info_->build_no >= 2743;
439 else 442 else
440 return browser_info_->major_version >= 52; 443 return browser_info_->major_version >= 52;
441 } 444 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698