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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_browsertest.cc

Issue 2438023003: devtools: Adds Page.getLayoutMetrics. (Closed)
Patch Set: address comments. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/page/get-layout-metrics.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/page/get-layout-metrics.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698