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

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

Issue 1033733007: [PresentationAPI] renamed GetScreenAvailability to ListenForScreenAvailability for consistency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the test 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 fcb7b91f4685fd24356a4fa679544c285c69a565..93d02f5cf0fa9b319f9d648bc760479f445b0aed 100644
--- a/content/browser/presentation/presentation_service_impl_unittest.cc
+++ b/content/browser/presentation/presentation_service_impl_unittest.cc
@@ -91,7 +91,7 @@ class PresentationServiceImplTest : public RenderViewHostImplTestHarness {
RenderViewHostImplTestHarness::TearDown();
}
- void GetScreenAvailabilityAndWait(
+ void ListenForScreenAvailabilityAndWait(
const std::string& presentation_url,
const base::Callback<void(const std::string&, bool)>& callback,
bool delegate_success) {
@@ -104,7 +104,7 @@ class PresentationServiceImplTest : public RenderViewHostImplTestHarness {
.WillOnce(DoAll(
InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit),
Return(delegate_success)));
- service_ptr_->GetScreenAvailability(presentation_url, callback);
+ service_ptr_->ListenForScreenAvailability(presentation_url, callback);
run_loop.Run();
EXPECT_TRUE(Mock::VerifyAndClearExpectations(&mock_delegate_));
@@ -190,9 +190,9 @@ class PresentationServiceImplTest : public RenderViewHostImplTestHarness {
int callback_count_;
};
-TEST_F(PresentationServiceImplTest, GetScreenAvailability) {
+TEST_F(PresentationServiceImplTest, ListenForScreenAvailability) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
@@ -200,7 +200,7 @@ TEST_F(PresentationServiceImplTest, GetScreenAvailability) {
true);
// Different presentation URL.
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
"http://barUrl",
base::Bind(&PresentationServiceImplTest::ShouldNotBeCalled,
base::Unretained(this)),
@@ -217,7 +217,7 @@ TEST_F(PresentationServiceImplTest, GetScreenAvailability) {
// Register another callback which should immediately invoke callback
// since updated result is available.
- service_ptr_->GetScreenAvailability(
+ service_ptr_->ListenForScreenAvailability(
presentation_url,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
@@ -229,7 +229,7 @@ TEST_F(PresentationServiceImplTest, GetScreenAvailability) {
TEST_F(PresentationServiceImplTest, Reset) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(&PresentationServiceImplTest::ShouldNotBeCalled,
base::Unretained(this)),
@@ -244,7 +244,7 @@ TEST_F(PresentationServiceImplTest, Reset) {
TEST_F(PresentationServiceImplTest, DidNavigateThisFrame) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(&PresentationServiceImplTest::ShouldNotBeCalled,
base::Unretained(this)),
@@ -260,7 +260,7 @@ TEST_F(PresentationServiceImplTest, DidNavigateThisFrame) {
TEST_F(PresentationServiceImplTest, DidNavigateNotThisFrame) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
@@ -283,7 +283,7 @@ TEST_F(PresentationServiceImplTest, DidNavigateNotThisFrame) {
TEST_F(PresentationServiceImplTest, ThisRenderFrameDeleted) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(&PresentationServiceImplTest::ShouldNotBeCalled,
base::Unretained(this)),
@@ -296,7 +296,7 @@ TEST_F(PresentationServiceImplTest, ThisRenderFrameDeleted) {
TEST_F(PresentationServiceImplTest, NotThisRenderFrameDeleted) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
@@ -314,9 +314,9 @@ TEST_F(PresentationServiceImplTest, NotThisRenderFrameDeleted) {
EXPECT_EQ(1, callback_count_);
}
-TEST_F(PresentationServiceImplTest, GetScreenAvailabilityTwice) {
+TEST_F(PresentationServiceImplTest, ListenForScreenAvailabilityTwice) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
@@ -326,14 +326,14 @@ TEST_F(PresentationServiceImplTest, GetScreenAvailabilityTwice) {
// Second call should overwrite the callback from first call.
// It shouldn't result in an extra call to delegate.
- service_ptr_->GetScreenAvailability(
+ service_ptr_->ListenForScreenAvailability(
presentation_url,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
base::Unretained(this),
false));
- // Cannot use GetScreenAvailabilityAndWait here since the mock delegate
+ // Cannot use ListenForScreenAvailabilityAndWait here since the mock delegate
// won't be triggered again to quit the RunLoop.
RunLoopFor(base::TimeDelta::FromMilliseconds(50));
@@ -346,7 +346,7 @@ TEST_F(PresentationServiceImplTest, GetScreenAvailabilityTwice) {
TEST_F(PresentationServiceImplTest, DelegateFails) {
std::string presentation_url("http://fooUrl");
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
presentation_url,
base::Bind(&PresentationServiceImplTest::ShouldNotBeCalled,
base::Unretained(this)),
@@ -365,7 +365,7 @@ TEST_F(PresentationServiceImplTest, SetDefaultPresentationUrl) {
EXPECT_EQ(url1, service_impl_->default_presentation_url_);
// Now there should be a callback registered with the DPU.
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
url1,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
@@ -425,7 +425,7 @@ TEST_F(PresentationServiceImplTest, ClearDefaultPresentationUrl) {
EXPECT_EQ(url, service_impl_->default_presentation_url_);
// Now there should be a callback registered with the DPU.
- GetScreenAvailabilityAndWait(
+ ListenForScreenAvailabilityAndWait(
url,
base::Bind(
&PresentationServiceImplTest::ScreenAvailabilityChangedCallback,
« no previous file with comments | « content/browser/presentation/presentation_service_impl.cc ('k') | content/common/presentation/presentation_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698