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

Side by Side Diff: chrome/browser/nacl_host/pnacl_host_unittest.cc

Issue 22309007: Add success status to ReportTranslationFinished in ppb_nacl_private and IPC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jvoung, dmichael reviews Created 7 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/nacl_host/pnacl_host.h" 5 #include "chrome/browser/nacl_host/pnacl_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 0, 66 0,
67 0, 67 0,
68 info, 68 info,
69 base::Bind(&PnaclHostTest::CallbackExpectMiss, base::Unretained(this))); 69 base::Bind(&PnaclHostTest::CallbackExpectMiss, base::Unretained(this)));
70 70
71 EXPECT_PENDING_TRANSLATIONS(1); 71 EXPECT_PENDING_TRANSLATIONS(1);
72 content::BrowserThread::GetBlockingPool()->FlushForTesting(); 72 content::BrowserThread::GetBlockingPool()->FlushForTesting();
73 base::RunLoop().RunUntilIdle(); 73 base::RunLoop().RunUntilIdle();
74 EXPECT_PENDING_TRANSLATIONS(1); 74 EXPECT_PENDING_TRANSLATIONS(1);
75 ExpectCallbackCount(1); 75 ExpectCallbackCount(1);
76 host_->TranslationFinished(0, 0); 76 host_->TranslationFinished(0, 0, true);
77 EXPECT_PENDING_TRANSLATIONS(0); 77 EXPECT_PENDING_TRANSLATIONS(0);
78 host_->RendererClosing(0); 78 host_->RendererClosing(0);
79 } 79 }
80 80
81 TEST_F(PnaclHostTest, BadArguments) { 81 TEST_F(PnaclHostTest, BadArguments) {
82 nacl::PnaclCacheInfo info; 82 nacl::PnaclCacheInfo info;
83 host_->GetNexeFd( 83 host_->GetNexeFd(
84 0, 84 0,
85 base::ProcessHandle(), 85 base::ProcessHandle(),
86 0, 86 0,
87 0, 87 0,
88 info, 88 info,
89 base::Bind(&PnaclHostTest::CallbackExpectMiss, base::Unretained(this))); 89 base::Bind(&PnaclHostTest::CallbackExpectMiss, base::Unretained(this)));
90 90
91 EXPECT_PENDING_TRANSLATIONS(1); 91 EXPECT_PENDING_TRANSLATIONS(1);
92 host_->TranslationFinished(0, 1); // nonexistent translation 92 host_->TranslationFinished(0, 1, true); // nonexistent translation
93 EXPECT_PENDING_TRANSLATIONS(1); 93 EXPECT_PENDING_TRANSLATIONS(1);
94 host_->RendererClosing(1); // nonexistent renderer 94 host_->RendererClosing(1); // nonexistent renderer
95 EXPECT_PENDING_TRANSLATIONS(1); 95 EXPECT_PENDING_TRANSLATIONS(1);
96 content::BrowserThread::GetBlockingPool()->FlushForTesting(); 96 content::BrowserThread::GetBlockingPool()->FlushForTesting();
97 base::RunLoop().RunUntilIdle(); 97 base::RunLoop().RunUntilIdle();
98 ExpectCallbackCount(1); 98 ExpectCallbackCount(1);
99 host_->RendererClosing(0); // close without finishing 99 host_->RendererClosing(0); // close without finishing
100 EXPECT_PENDING_TRANSLATIONS(0); 100 EXPECT_PENDING_TRANSLATIONS(0);
101 } 101 }
102 102
103 } // namespace pnacl 103 } // namespace pnacl
OLDNEW
« no previous file with comments | « chrome/browser/nacl_host/pnacl_host.cc ('k') | chrome/renderer/pepper/pnacl_translation_resource_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698