Chromium Code Reviews| Index: chrome/test/chromedriver/session_commands.cc |
| diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc |
| index ecfe4a795013e12ff5c873ec67f0b1e450e9186c..48ad77d7f1c7bddb310ff719df20b306b89bc8b0 100644 |
| --- a/chrome/test/chromedriver/session_commands.cc |
| +++ b/chrome/test/chromedriver/session_commands.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/files/file_util.h" |
| #include "base/logging.h" // For CHECK macros. |
| #include "base/memory/ref_counted.h" |
| +#include "base/strings/string_util.h" |
| #include "base/synchronization/lock.h" |
| #include "base/synchronization/waitable_event.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| @@ -62,10 +63,11 @@ std::string WebViewIdToWindowHandle(const std::string& web_view_id) { |
| bool WindowHandleToWebViewId(const std::string& window_handle, |
| std::string* web_view_id) { |
| - if (window_handle.find(kWindowHandlePrefix) != 0u) |
| + if (!base::StartsWith(window_handle, kWindowHandlePrefix, |
| + base::CompareCase::SENSITIVE)) { |
| return false; |
| - *web_view_id = window_handle.substr( |
| - std::string(kWindowHandlePrefix).length()); |
|
Lei Zhang
2016/07/07 22:33:49
At least this is test code?
lazyboy
2016/07/07 23:44:50
Reverted.
Done.
Lei Zhang
2016/07/07 23:50:08
No, no, I was fine with the change. I dislike the
lazyboy
2016/07/07 23:57:11
Ah, deleted patchset #3
|
| + } |
| + *web_view_id = window_handle.substr(sizeof(kWindowHandlePrefix) - 1); |
| return true; |
| } |