OLD | NEW |
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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/intents/web_intents_registry.h" | 10 #include "chrome/browser/intents/web_intents_registry.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 if (wds_.get()) | 34 if (wds_.get()) |
35 wds_->Shutdown(); | 35 wds_->Shutdown(); |
36 | 36 |
37 db_thread_.Stop(); | 37 db_thread_.Stop(); |
38 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 38 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); |
39 MessageLoop::current()->Run(); | 39 MessageLoop::current()->Run(); |
40 } | 40 } |
41 | 41 |
42 void LoadRegistry() { | 42 void LoadRegistry() { |
43 { | 43 { |
44 WebIntentServiceData service; | 44 webkit_glue::WebIntentServiceData service; |
45 service.service_url = GURL("http://www.google.com/share"); | 45 service.service_url = GURL("http://www.google.com/share"); |
46 service.action = ASCIIToUTF16("SHARE"); | 46 service.action = ASCIIToUTF16("SHARE"); |
47 service.type = ASCIIToUTF16("text/url"); | 47 service.type = ASCIIToUTF16("text/url"); |
48 service.title = ASCIIToUTF16("Google"); | 48 service.title = ASCIIToUTF16("Google"); |
49 registry_.RegisterIntentProvider(service); | 49 registry_.RegisterIntentProvider(service); |
50 } | 50 } |
51 { | 51 { |
52 WebIntentServiceData service; | 52 webkit_glue::WebIntentServiceData service; |
53 service.service_url = GURL("http://picasaweb.google.com/share"); | 53 service.service_url = GURL("http://picasaweb.google.com/share"); |
54 service.action = ASCIIToUTF16("EDIT"); | 54 service.action = ASCIIToUTF16("EDIT"); |
55 service.type = ASCIIToUTF16("image/*"); | 55 service.type = ASCIIToUTF16("image/*"); |
56 service.title = ASCIIToUTF16("Picasa"); | 56 service.title = ASCIIToUTF16("Picasa"); |
57 registry_.RegisterIntentProvider(service); | 57 registry_.RegisterIntentProvider(service); |
58 } | 58 } |
59 { | 59 { |
60 WebIntentServiceData service; | 60 webkit_glue::WebIntentServiceData service; |
61 service.service_url = GURL("http://www.digg.com/share"); | 61 service.service_url = GURL("http://www.digg.com/share"); |
62 service.action = ASCIIToUTF16("SHARE"); | 62 service.action = ASCIIToUTF16("SHARE"); |
63 service.type = ASCIIToUTF16("text/url"); | 63 service.type = ASCIIToUTF16("text/url"); |
64 service.title = ASCIIToUTF16("Digg"); | 64 service.title = ASCIIToUTF16("Digg"); |
65 registry_.RegisterIntentProvider(service); | 65 registry_.RegisterIntentProvider(service); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 MessageLoopForUI message_loop_; | 69 MessageLoopForUI message_loop_; |
70 content::TestBrowserThread ui_thread_; | 70 content::TestBrowserThread ui_thread_; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 EXPECT_EQ(static_cast<size_t>(1), snode->Types().GetSize()); | 176 EXPECT_EQ(static_cast<size_t>(1), snode->Types().GetSize()); |
177 string16 stype; | 177 string16 stype; |
178 ASSERT_TRUE(snode->Types().GetString(0, &stype)); | 178 ASSERT_TRUE(snode->Types().GetString(0, &stype)); |
179 EXPECT_EQ(ASCIIToUTF16("text/url"), stype); | 179 EXPECT_EQ(ASCIIToUTF16("text/url"), stype); |
180 | 180 |
181 node = intents_model.GetTreeNode("www.digg.com"); | 181 node = intents_model.GetTreeNode("www.digg.com"); |
182 ASSERT_NE(static_cast<WebIntentsTreeNode*>(NULL), node); | 182 ASSERT_NE(static_cast<WebIntentsTreeNode*>(NULL), node); |
183 EXPECT_EQ(WebIntentsTreeNode::TYPE_ORIGIN, node->Type()); | 183 EXPECT_EQ(WebIntentsTreeNode::TYPE_ORIGIN, node->Type()); |
184 EXPECT_EQ(ASCIIToUTF16("www.digg.com"), node->GetTitle()); | 184 EXPECT_EQ(ASCIIToUTF16("www.digg.com"), node->GetTitle()); |
185 } | 185 } |
OLD | NEW |