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

Side by Side Diff: chrome/browser/ui/intents/web_intents_model_unittest.cc

Issue 7930002: Rename WebIntentData for backend storage to WebIntentServiceData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix class/struct decl Created 9 years, 3 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
OLDNEW
1 // Copyright (c) 2011 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/scoped_temp_dir.h" 6 #include "base/scoped_temp_dir.h"
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/intents/web_intents_registry.h" 10 #include "chrome/browser/intents/web_intents_registry.h"
(...skipping 22 matching lines...) Expand all
33 if (wds_.get()) 33 if (wds_.get())
34 wds_->Shutdown(); 34 wds_->Shutdown();
35 35
36 db_thread_.Stop(); 36 db_thread_.Stop();
37 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); 37 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask);
38 MessageLoop::current()->Run(); 38 MessageLoop::current()->Run();
39 } 39 }
40 40
41 void LoadRegistry() { 41 void LoadRegistry() {
42 { 42 {
43 WebIntentData provider; 43 WebIntentServiceData service;
44 provider.service_url = GURL("http://www.google.com/share"); 44 service.service_url = GURL("http://www.google.com/share");
45 provider.action = ASCIIToUTF16("SHARE"); 45 service.action = ASCIIToUTF16("SHARE");
46 provider.type = ASCIIToUTF16("text/url"); 46 service.type = ASCIIToUTF16("text/url");
47 provider.title = ASCIIToUTF16("Google"); 47 service.title = ASCIIToUTF16("Google");
48 registry_.RegisterIntentProvider(provider); 48 registry_.RegisterIntentProvider(service);
49 } 49 }
50 { 50 {
51 WebIntentData provider; 51 WebIntentServiceData service;
52 provider.service_url = GURL("http://picasaweb.google.com/share"); 52 service.service_url = GURL("http://picasaweb.google.com/share");
53 provider.action = ASCIIToUTF16("EDIT"); 53 service.action = ASCIIToUTF16("EDIT");
54 provider.type = ASCIIToUTF16("image/*"); 54 service.type = ASCIIToUTF16("image/*");
55 provider.title = ASCIIToUTF16("Picasa"); 55 service.title = ASCIIToUTF16("Picasa");
56 registry_.RegisterIntentProvider(provider); 56 registry_.RegisterIntentProvider(service);
57 } 57 }
58 { 58 {
59 WebIntentData provider; 59 WebIntentServiceData service;
60 provider.service_url = GURL("http://www.digg.com/share"); 60 service.service_url = GURL("http://www.digg.com/share");
61 provider.action = ASCIIToUTF16("SHARE"); 61 service.action = ASCIIToUTF16("SHARE");
62 provider.type = ASCIIToUTF16("text/url"); 62 service.type = ASCIIToUTF16("text/url");
63 provider.title = ASCIIToUTF16("Digg"); 63 service.title = ASCIIToUTF16("Digg");
64 registry_.RegisterIntentProvider(provider); 64 registry_.RegisterIntentProvider(service);
65 } 65 }
66 } 66 }
67 67
68 MessageLoopForUI message_loop_; 68 MessageLoopForUI message_loop_;
69 BrowserThread ui_thread_; 69 BrowserThread ui_thread_;
70 BrowserThread db_thread_; 70 BrowserThread db_thread_;
71 scoped_refptr<WebDataService> wds_; 71 scoped_refptr<WebDataService> wds_;
72 WebIntentsRegistry registry_; 72 WebIntentsRegistry registry_;
73 ScopedTempDir temp_dir_; 73 ScopedTempDir temp_dir_;
74 }; 74 };
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 EXPECT_EQ(static_cast<size_t>(1), snode->Types().GetSize()); 175 EXPECT_EQ(static_cast<size_t>(1), snode->Types().GetSize());
176 string16 stype; 176 string16 stype;
177 ASSERT_TRUE(snode->Types().GetString(0, &stype)); 177 ASSERT_TRUE(snode->Types().GetString(0, &stype));
178 EXPECT_EQ(ASCIIToUTF16("text/url"), stype); 178 EXPECT_EQ(ASCIIToUTF16("text/url"), stype);
179 179
180 node = intents_model.GetTreeNode("www.digg.com"); 180 node = intents_model.GetTreeNode("www.digg.com");
181 ASSERT_NE(static_cast<WebIntentsTreeNode*>(NULL), node); 181 ASSERT_NE(static_cast<WebIntentsTreeNode*>(NULL), node);
182 EXPECT_EQ(WebIntentsTreeNode::TYPE_ORIGIN, node->Type()); 182 EXPECT_EQ(WebIntentsTreeNode::TYPE_ORIGIN, node->Type());
183 EXPECT_EQ(ASCIIToUTF16("www.digg.com"), node->GetTitle()); 183 EXPECT_EQ(ASCIIToUTF16("www.digg.com"), node->GetTitle());
184 } 184 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intents_model.cc ('k') | chrome/browser/ui/webui/options/web_intents_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698