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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "chrome/browser/extensions/activity_log.h" | 8 #include "chrome/browser/extensions/activity_log.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/test_extension_system.h" | 10 #include "chrome/browser/extensions/test_extension_system.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 34 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
35 extension_service_ = static_cast<TestExtensionSystem*>( | 35 extension_service_ = static_cast<TestExtensionSystem*>( |
36 ExtensionSystem::Get(profile_))->CreateExtensionService( | 36 ExtensionSystem::Get(profile_))->CreateExtensionService( |
37 &command_line, FilePath(), false); | 37 &command_line, FilePath(), false); |
38 CommandLine::ForCurrentProcess()->AppendSwitch( | 38 CommandLine::ForCurrentProcess()->AppendSwitch( |
39 switches::kEnableExtensionActivityUI); | 39 switches::kEnableExtensionActivityUI); |
40 ActivityLog::RecomputeLoggingIsEnabled(); | 40 ActivityLog::RecomputeLoggingIsEnabled(); |
41 db_thread_.Start(); | 41 db_thread_.Start(); |
42 } | 42 } |
43 | 43 |
44 ~ActivityLogTest() { | 44 virtual ~ActivityLogTest() { |
45 base::WaitableEvent done(false, false); | 45 base::WaitableEvent done(false, false); |
46 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 46 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
47 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 47 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
48 done.Wait(); | 48 done.Wait(); |
49 db_thread_.Stop(); | 49 db_thread_.Stop(); |
50 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 50 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
51 MessageLoop::current()->Run(); | 51 MessageLoop::current()->Run(); |
52 } | 52 } |
53 | 53 |
54 protected: | 54 protected: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 ASSERT_EQ("CALL", statement.ColumnString(2)); | 107 ASSERT_EQ("CALL", statement.ColumnString(2)); |
108 ASSERT_EQ("UNKNOWN_VERB", statement.ColumnString(3)); | 108 ASSERT_EQ("UNKNOWN_VERB", statement.ColumnString(3)); |
109 ASSERT_EQ("TABS", statement.ColumnString(4)); | 109 ASSERT_EQ("TABS", statement.ColumnString(4)); |
110 ASSERT_EQ("tabs.testMethod()", statement.ColumnString(5)); | 110 ASSERT_EQ("tabs.testMethod()", statement.ColumnString(5)); |
111 #endif | 111 #endif |
112 } | 112 } |
113 | 113 |
114 } // namespace extensions | 114 } // namespace extensions |
115 | 115 |
OLD | NEW |