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

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

Issue 10185008: Taking over issue 10006037: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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) 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
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_->ShutdownOnUIThread();
38 wds_->Shutdown(); 38 wds_ = NULL;
39 39 base::WaitableEvent done(false, false);
40 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
41 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done)));
42 done.Wait();
40 db_thread_.Stop(); 43 db_thread_.Stop();
41 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 44 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
42 MessageLoop::current()->Run(); 45 MessageLoop::current()->Run();
43 } 46 }
44 47
45 void LoadRegistry() { 48 void LoadRegistry() {
46 { 49 {
47 webkit_glue::WebIntentServiceData service; 50 webkit_glue::WebIntentServiceData service;
48 service.service_url = GURL("http://www.google.com/share"); 51 service.service_url = GURL("http://www.google.com/share");
49 service.action = ASCIIToUTF16("SHARE"); 52 service.action = ASCIIToUTF16("SHARE");
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 206
204 WebIntentsTreeNode* node = intents_model.GetTreeNode("www.google.com"); 207 WebIntentsTreeNode* node = intents_model.GetTreeNode("www.google.com");
205 ASSERT_EQ(2, node->child_count()); 208 ASSERT_EQ(2, node->child_count());
206 node = node->GetChild(1); 209 node = node->GetChild(1);
207 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); 210 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type());
208 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); 211 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type());
209 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(node); 212 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(node);
210 EXPECT_EQ(ASCIIToUTF16("XEDIT"), snode->Action()); 213 EXPECT_EQ(ASCIIToUTF16("XEDIT"), snode->Action());
211 EXPECT_EQ(ASCIIToUTF16("http://www.google.com/xedit"), snode->ServiceUrl()); 214 EXPECT_EQ(ASCIIToUTF16("http://www.google.com/xedit"), snode->ServiceUrl());
212 } 215 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc ('k') | chrome/browser/webdata/web_data_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698