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

Unified Diff: content/shell/test_runner/web_frame_test_client.cc

Issue 2714943004: Move unique name generation and tracking into //content. (Closed)
Patch Set: . Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/test_runner/web_frame_test_client.cc
diff --git a/content/shell/test_runner/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc
index ac85df245e22584c5628b14d64a80034f98aec02..1f83572f715674d47e972b3c091a9f77aa8389e2 100644
--- a/content/shell/test_runner/web_frame_test_client.cc
+++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -10,6 +10,7 @@
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "content/renderer/render_frame_impl.h"
#include "content/shell/test_runner/accessibility_controller.h"
#include "content/shell/test_runner/event_sender.h"
#include "content/shell/test_runner/mock_color_chooser.h"
@@ -44,21 +45,20 @@ namespace test_runner {
namespace {
-void PrintFrameDescription(WebTestDelegate* delegate, blink::WebFrame* frame) {
- std::string name8 = frame->uniqueName().utf8();
+void PrintFrameDescription(WebTestDelegate* delegate,
+ blink::WebLocalFrame* frame) {
+ const std::string& name =
+ content::RenderFrameImpl::FromWebFrame(frame)->unique_name();
if (frame == frame->view()->mainFrame()) {
- if (!name8.length()) {
- delegate->PrintMessage("main frame");
- return;
- }
- delegate->PrintMessage(std::string("main frame \"") + name8 + "\"");
+ DCHECK(name.empty());
+ delegate->PrintMessage("main frame");
return;
}
- if (!name8.length()) {
+ if (name.empty()) {
delegate->PrintMessage("frame (anonymous)");
return;
}
- delegate->PrintMessage(std::string("frame \"") + name8 + "\"");
+ delegate->PrintMessage(std::string("frame \"") + name + "\"");
}
void PrintFrameuserGestureStatus(WebTestDelegate* delegate,

Powered by Google App Engine
This is Rietveld 408576698