Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 // pending or scheduled frames, since we're about to navigate away from | 321 // pending or scheduled frames, since we're about to navigate away from |
| 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; |
|
samuong
2016/08/05 21:23:59
need to declare and initialize |context| here?
dgozman
2016/08/05 21:33:31
My bad! Looks like I didn't build chromedriver_uni
| |
| 332 if (!params.GetString("context.frameId", &frame_id)) | 332 if (context->HasKey("auxData")) { |
| 333 return Status(kUnknownError, "missing or invalid 'context.frameId'"); | 333 const base::DictionaryValue* auxData; |
| 334 if (!context->GetDictionary("auxData", &auxData)) | |
| 335 return Status(kUnknownError, "missing or invalid 'context.auxData'"); | |
| 336 if (!auxData->GetString("frameId", &frame_id)) | |
| 337 return Status(kUnknownError, "missing or invalid 'context.frameId'"); | |
| 338 } | |
| 339 if (context->HasKey("frameId")) { | |
| 340 // TODO(samuong): remove this when we stop supporting Chrome 53. | |
| 341 if (!params.GetString("context.frameId", &frame_id)) | |
| 342 return Status(kUnknownError, "missing or invalid 'context.frameId'"); | |
| 343 } | |
| 334 if (frame_id == dummy_frame_id_) | 344 if (frame_id == dummy_frame_id_) |
| 335 dummy_execution_context_id_ = execution_context_id; | 345 dummy_execution_context_id_ = execution_context_id; |
| 336 else | 346 else |
| 337 execution_context_set_.insert(execution_context_id); | 347 execution_context_set_.insert(execution_context_id); |
| 338 } | 348 } |
| 339 } else if (method == "Runtime.executionContextDestroyed") { | 349 } else if (method == "Runtime.executionContextDestroyed") { |
| 340 if (!IsExpectingFrameLoadingEvents()) { | 350 if (!IsExpectingFrameLoadingEvents()) { |
| 341 int execution_context_id; | 351 int execution_context_id; |
| 342 if (!params.GetInteger("executionContextId", &execution_context_id)) | 352 if (!params.GetInteger("executionContextId", &execution_context_id)) |
| 343 return Status(kUnknownError, "missing or invalid 'context.id'"); | 353 return Status(kUnknownError, "missing or invalid 'context.id'"); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 // modal dialogs. This pauses the render process so we need to be careful not | 442 // 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 | 443 // to issue Runtime.evaluate commands while an alert is up, otherwise the call |
| 434 // will block and timeout. For details refer to | 444 // will block and timeout. For details refer to |
| 435 // https://bugs.chromium.org/p/chromedriver/issues/detail?id=1381. | 445 // https://bugs.chromium.org/p/chromedriver/issues/detail?id=1381. |
| 436 // TODO(samuong): Remove this once we stop supporting M51. | 446 // TODO(samuong): Remove this once we stop supporting M51. |
| 437 if (browser_info_->browser_name == "chrome") | 447 if (browser_info_->browser_name == "chrome") |
| 438 return browser_info_->build_no >= 2743; | 448 return browser_info_->build_no >= 2743; |
| 439 else | 449 else |
| 440 return browser_info_->major_version >= 52; | 450 return browser_info_->major_version >= 52; |
| 441 } | 451 } |
| OLD | NEW |