OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 base::ListValue* target_infos; | 966 base::ListValue* target_infos; |
967 EXPECT_TRUE(result_->GetList("targetInfo", &target_infos)); | 967 EXPECT_TRUE(result_->GetList("targetInfo", &target_infos)); |
968 EXPECT_EQ(1u, target_infos->GetSize()); | 968 EXPECT_EQ(1u, target_infos->GetSize()); |
969 base::DictionaryValue* target_info; | 969 base::DictionaryValue* target_info; |
970 EXPECT_TRUE(target_infos->GetDictionary(0u, &target_info)); | 970 EXPECT_TRUE(target_infos->GetDictionary(0u, &target_info)); |
971 std::string target_id, type, title, url; | 971 std::string target_id, type, title, url; |
972 EXPECT_TRUE(target_info->GetString("targetId", &target_id)); | 972 EXPECT_TRUE(target_info->GetString("targetId", &target_id)); |
973 EXPECT_TRUE(target_info->GetString("type", &type)); | 973 EXPECT_TRUE(target_info->GetString("type", &type)); |
974 EXPECT_TRUE(target_info->GetString("title", &title)); | 974 EXPECT_TRUE(target_info->GetString("title", &title)); |
975 EXPECT_TRUE(target_info->GetString("url", &url)); | 975 EXPECT_TRUE(target_info->GetString("url", &url)); |
976 EXPECT_EQ(type, "page"); | 976 EXPECT_EQ("page", type); |
977 EXPECT_EQ(title, "about:blank"); | 977 EXPECT_EQ("about:blank", title); |
978 EXPECT_EQ(url, "about:blank"); | 978 EXPECT_EQ("about:blank", url); |
979 } | 979 } |
980 | 980 |
981 namespace { | 981 namespace { |
982 class NavigationFinishedObserver : public content::WebContentsObserver { | 982 class NavigationFinishedObserver : public content::WebContentsObserver { |
983 public: | 983 public: |
984 explicit NavigationFinishedObserver(WebContents* web_contents) | 984 explicit NavigationFinishedObserver(WebContents* web_contents) |
985 : WebContentsObserver(web_contents), | 985 : WebContentsObserver(web_contents), |
986 num_finished_(0), | 986 num_finished_(0), |
987 num_to_wait_for_(0) {} | 987 num_to_wait_for_(0) {} |
988 | 988 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 command_params.reset(new base::DictionaryValue()); | 1395 command_params.reset(new base::DictionaryValue()); |
1396 command_params->SetBoolean("autoAttach", false); | 1396 command_params->SetBoolean("autoAttach", false); |
1397 command_params->SetBoolean("waitForDebuggerOnStart", false); | 1397 command_params->SetBoolean("waitForDebuggerOnStart", false); |
1398 SendCommand("Target.setAutoAttach", std::move(command_params), false); | 1398 SendCommand("Target.setAutoAttach", std::move(command_params), false); |
1399 params = WaitForNotification("Target.detachedFromTarget", true); | 1399 params = WaitForNotification("Target.detachedFromTarget", true); |
1400 EXPECT_TRUE(params->GetString("targetId", &temp)); | 1400 EXPECT_TRUE(params->GetString("targetId", &temp)); |
1401 EXPECT_EQ(target_id, temp); | 1401 EXPECT_EQ(target_id, temp); |
1402 } | 1402 } |
1403 | 1403 |
1404 } // namespace content | 1404 } // namespace content |
OLD | NEW |