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

Side by Side Diff: ui/base/dragdrop/gtk_dnd_util_unittest.cc

Issue 6250014: Move more dnd related files to ui/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/dragdrop/gtk_dnd_util.cc ('k') | ui/base/dragdrop/os_exchange_data.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 6
7 #include "app/gtk_dnd_util.h"
8 #include "base/pickle.h" 7 #include "base/pickle.h"
9 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
10 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
11 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
12 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "ui/base/dragdrop/gtk_dnd_util.h"
13
14 namespace ui {
13 15
14 TEST(GtkDndUtilTest, ExtractNamedURLValid) { 16 TEST(GtkDndUtilTest, ExtractNamedURLValid) {
15 const std::string kTitle = "title"; 17 const std::string kTitle = "title";
16 const std::string kUrl = "http://www.foobar.com/"; 18 const std::string kUrl = "http://www.foobar.com/";
17 Pickle pickle; 19 Pickle pickle;
18 pickle.WriteString(kTitle); 20 pickle.WriteString(kTitle);
19 pickle.WriteString(kUrl); 21 pickle.WriteString(kUrl);
20 22
21 GtkSelectionData data; 23 GtkSelectionData data;
22 scoped_array<guchar> test_data(new guchar[pickle.size()]); 24 scoped_array<guchar> test_data(new guchar[pickle.size()]);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 Pickle pickle; 70 Pickle pickle;
69 pickle.WriteString(kTitle); 71 pickle.WriteString(kTitle);
70 72
71 scoped_array<guchar> test_data(new guchar[pickle.size()]); 73 scoped_array<guchar> test_data(new guchar[pickle.size()]);
72 memcpy(test_data.get(), pickle.data(), pickle.size()); 74 memcpy(test_data.get(), pickle.data(), pickle.size());
73 data.data = test_data.get(); 75 data.data = test_data.get();
74 data.length = pickle.size(); 76 data.length = pickle.size();
75 77
76 EXPECT_FALSE(gtk_dnd_util::ExtractNamedURL(&data, &url, &title)); 78 EXPECT_FALSE(gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
77 } 79 }
80
81 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/dragdrop/gtk_dnd_util.cc ('k') | ui/base/dragdrop/os_exchange_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698