OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 virtual void SetUp() { | 27 virtual void SetUp() { |
28 db_thread_.Start(); | 28 db_thread_.Start(); |
29 wds_ = new WebDataService(); | 29 wds_ = new WebDataService(); |
30 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 30 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
31 wds_->Init(temp_dir_.path()); | 31 wds_->Init(temp_dir_.path()); |
32 | 32 |
33 registry_.Initialize(wds_, NULL); | 33 registry_.Initialize(wds_, NULL); |
34 } | 34 } |
35 | 35 |
36 virtual void TearDown() { | 36 virtual void TearDown() { |
37 if (wds_.get()) | 37 wds_ = NULL; |
38 wds_->Shutdown(); | |
39 | 38 |
40 db_thread_.Stop(); | 39 db_thread_.Stop(); |
41 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 40 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
42 MessageLoop::current()->Run(); | 41 MessageLoop::current()->Run(); |
43 } | 42 } |
44 | 43 |
45 void LoadRegistry() { | 44 void LoadRegistry() { |
46 { | 45 { |
47 webkit_glue::WebIntentServiceData service; | 46 webkit_glue::WebIntentServiceData service; |
48 service.service_url = GURL("http://www.google.com/share"); | 47 service.service_url = GURL("http://www.google.com/share"); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 202 |
204 WebIntentsTreeNode* node = intents_model.GetTreeNode("www.google.com"); | 203 WebIntentsTreeNode* node = intents_model.GetTreeNode("www.google.com"); |
205 ASSERT_EQ(2, node->child_count()); | 204 ASSERT_EQ(2, node->child_count()); |
206 node = node->GetChild(1); | 205 node = node->GetChild(1); |
207 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); | 206 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); |
208 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); | 207 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); |
209 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(node); | 208 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(node); |
210 EXPECT_EQ(ASCIIToUTF16("EDIT"), snode->Action()); | 209 EXPECT_EQ(ASCIIToUTF16("EDIT"), snode->Action()); |
211 EXPECT_EQ(ASCIIToUTF16("http://www.google.com/edit"), snode->ServiceUrl()); | 210 EXPECT_EQ(ASCIIToUTF16("http://www.google.com/edit"), snode->ServiceUrl()); |
212 } | 211 } |
OLD | NEW |