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

Side by Side Diff: chrome/browser/utility_process_host_unittest.cc

Issue 155331: plugins: use OnChannelError to detect when the channel goes away (Closed)
Patch Set: with a fix to a unit test Created 11 years, 5 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/utility_process_host.h" 5 #include "chrome/browser/utility_process_host.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 FilePath temp_extension_dir; 99 FilePath temp_extension_dir;
100 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &temp_extension_dir)); 100 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &temp_extension_dir));
101 temp_extension_dir = temp_extension_dir.AppendASCII("extension_test"); 101 temp_extension_dir = temp_extension_dir.AppendASCII("extension_test");
102 ASSERT_TRUE(file_util::CreateDirectory(temp_extension_dir)); 102 ASSERT_TRUE(file_util::CreateDirectory(temp_extension_dir));
103 ASSERT_TRUE(file_util::CopyFile(extension_file, 103 ASSERT_TRUE(file_util::CopyFile(extension_file,
104 temp_extension_dir.AppendASCII("theme.crx"))); 104 temp_extension_dir.AppendASCII("theme.crx")));
105 105
106 scoped_refptr<TestUtilityProcessHostClient> client( 106 scoped_refptr<TestUtilityProcessHostClient> client(
107 new TestUtilityProcessHostClient(&message_loop_)); 107 new TestUtilityProcessHostClient(&message_loop_));
108 ResourceDispatcherHost rdh(NULL); 108 ResourceDispatcherHost rdh(NULL);
109 TestUtilityProcessHost process_host(client.get(), &message_loop_, &rdh); 109 TestUtilityProcessHost* process_host =
110 process_host.StartExtensionUnpacker( 110 new TestUtilityProcessHost(client.get(), &message_loop_, &rdh);
111 // process_host will delete itself when it's done.
112 process_host->StartExtensionUnpacker(
111 temp_extension_dir.AppendASCII("theme.crx")); 113 temp_extension_dir.AppendASCII("theme.crx"));
112 message_loop_.Run(); 114 message_loop_.Run();
113 EXPECT_TRUE(client->success()); 115 EXPECT_TRUE(client->success());
114 116
115 // Clean up the temp dir. 117 // Clean up the temp dir.
116 file_util::Delete(temp_extension_dir, true); 118 file_util::Delete(temp_extension_dir, true);
117 } 119 }
118 120
119 } // namespace 121 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/utility_process_host.cc ('k') | chrome/browser/worker_host/worker_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698