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

Unified Diff: content/browser/presentation/presentation_service_impl_unittest.cc

Issue 1019173002: Update mojo sdk to rev 7214b7ec7d27563b2666afad86cf1c5895c56c18 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep permission service alive if embedder drops requests Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/presentation/presentation_service_impl_unittest.cc
diff --git a/content/browser/presentation/presentation_service_impl_unittest.cc b/content/browser/presentation/presentation_service_impl_unittest.cc
index 7068f561c7871cdae3972aec1bd2c1b432992f2e..fcb7b91f4685fd24356a4fa679544c285c69a565 100644
--- a/content/browser/presentation/presentation_service_impl_unittest.cc
+++ b/content/browser/presentation/presentation_service_impl_unittest.cc
@@ -318,8 +318,10 @@ TEST_F(PresentationServiceImplTest, GetScreenAvailabilityTwice) {
std::string presentation_url("http://fooUrl");
GetScreenAvailabilityAndWait(
presentation_url,
- base::Bind(&PresentationServiceImplTest::ShouldNotBeCalled,
- base::Unretained(this)),
+ base::Bind(
+ &PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
+ base::Unretained(this),
+ false),
true);
// Second call should overwrite the callback from first call.
@@ -339,7 +341,7 @@ TEST_F(PresentationServiceImplTest, GetScreenAvailabilityTwice) {
SimulateScreenAvailabilityChange(presentation_url, false);
SaveQuitClosureAndRunLoop();
- EXPECT_EQ(1, callback_count_);
+ EXPECT_EQ(2, callback_count_);
}
TEST_F(PresentationServiceImplTest, DelegateFails) {
@@ -372,7 +374,7 @@ TEST_F(PresentationServiceImplTest, SetDefaultPresentationUrl) {
const auto& contexts = service_impl_->availability_contexts_;
auto it = contexts.find(url1);
ASSERT_TRUE(it != contexts.end());
- EXPECT_NE(nullptr, it->second->GetCallback());
+ EXPECT_TRUE(it->second->HasPendingCallbacks());
std::string url2("http://barUrl");
// Sets different DPU.
@@ -394,7 +396,7 @@ TEST_F(PresentationServiceImplTest, SetDefaultPresentationUrl) {
it = contexts.find(url2);
ASSERT_TRUE(it != contexts.end());
- EXPECT_NE(nullptr, it->second->GetCallback());
+ EXPECT_TRUE(it->second->HasPendingCallbacks());
}
TEST_F(PresentationServiceImplTest, SetSameDefaultPresentationUrl) {
@@ -433,7 +435,7 @@ TEST_F(PresentationServiceImplTest, ClearDefaultPresentationUrl) {
const auto& contexts = service_impl_->availability_contexts_;
auto it = contexts.find(url);
ASSERT_TRUE(it != contexts.end());
- EXPECT_NE(nullptr, it->second->GetCallback());
+ EXPECT_TRUE(it->second->HasPendingCallbacks());
// Clears the default presentation URL. Transfers the listener from url to
// "1-UA" mode.
« no previous file with comments | « content/browser/presentation/presentation_service_impl.cc ('k') | third_party/mojo/mojo_edk_system_impl.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698