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

Unified Diff: content/renderer/render_view_impl_unittest.cc

Issue 130773004: Start moving context menu code to RenderFrame. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 11 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/renderer/render_view_impl_unittest.cc
===================================================================
--- content/renderer/render_view_impl_unittest.cc (revision 247964)
+++ content/renderer/render_view_impl_unittest.cc (working copy)
@@ -1,41 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/strings/utf_string_conversions.h"
-#include "content/public/common/context_menu_params.h"
-#include "content/renderer/render_view_impl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/range/range.h"
-
-namespace content {
-
-TEST(RenderViewImplTest, ShouldUpdateSelectionTextFromContextMenuParams) {
- struct {
- const char* selection_text;
- size_t selection_text_offset;
- gfx::Range selection_range;
- const char* params_selection_text;
- bool expected_result;
- } cases[] = {
- { "test", 0, gfx::Range(0, 4), "test", false },
- { "zebestest", 0, gfx::Range(2, 6), "best", false },
- { "zebestest", 2, gfx::Range(2, 6), "best", true },
- { "test", 0, gfx::Range(0, 4), "hello", true },
- { "best test", 0, gfx::Range(0, 4), "best ", false },
- { "best test", 0, gfx::Range(0, 5), "best", false },
- };
-
- ContextMenuParams params;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
- params.selection_text = base::UTF8ToUTF16(cases[i].params_selection_text);
- EXPECT_EQ(cases[i].expected_result,
- RenderViewImpl::ShouldUpdateSelectionTextFromContextMenuParams(
- base::UTF8ToUTF16(cases[i].selection_text),
- cases[i].selection_text_offset,
- cases[i].selection_range,
- params));
- }
-}
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698