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

Side by Side Diff: content/browser/media/session/media_session_browsertest.cc

Issue 2300083002: Wrap MediaMetadata in base::Optional in content and chrome (Closed)
Patch Set: fix Android build Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/media/session/media_session.h" 5 #include "content/browser/media/session/media_session.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <list> 9 #include <list>
10 #include <vector> 10 #include <vector>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 }; 48 };
49 49
50 class MockWebContentsObserver : public WebContentsObserver { 50 class MockWebContentsObserver : public WebContentsObserver {
51 public: 51 public:
52 MockWebContentsObserver(WebContents* web_contents) 52 MockWebContentsObserver(WebContents* web_contents)
53 : WebContentsObserver(web_contents) {} 53 : WebContentsObserver(web_contents) {}
54 54
55 MOCK_METHOD3(MediaSessionStateChanged, 55 MOCK_METHOD3(MediaSessionStateChanged,
56 void(bool is_controllable, bool is_suspended, 56 void(bool is_controllable, bool is_suspended,
57 const content::MediaMetadata& metadata)); 57 const base::Optional<content::MediaMetadata>& metadata));
58 }; 58 };
59 59
60 } // namespace 60 } // namespace
61 61
62 class MediaSessionBrowserTest : public content::ContentBrowserTest { 62 class MediaSessionBrowserTest : public content::ContentBrowserTest {
63 protected: 63 protected:
64 MediaSessionBrowserTest() = default; 64 MediaSessionBrowserTest() = default;
65 65
66 void SetUpOnMainThread() override { 66 void SetUpOnMainThread() override {
67 ContentBrowserTest::SetUpOnMainThread(); 67 ContentBrowserTest::SetUpOnMainThread();
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 media::MediaContentType::Persistent); 1338 media::MediaContentType::Persistent);
1339 clock->Advance(base::TimeDelta::FromMilliseconds(1000)); 1339 clock->Advance(base::TimeDelta::FromMilliseconds(1000));
1340 media_session_->Stop(MediaSession::SuspendType::UI); 1340 media_session_->Stop(MediaSession::SuspendType::UI);
1341 1341
1342 std::unique_ptr<base::HistogramSamples> samples( 1342 std::unique_ptr<base::HistogramSamples> samples(
1343 tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime")); 1343 tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
1344 EXPECT_EQ(2, samples->TotalCount()); 1344 EXPECT_EQ(2, samples->TotalCount());
1345 EXPECT_EQ(1, samples->GetCount(1000)); 1345 EXPECT_EQ(1, samples->GetCount(1000));
1346 EXPECT_EQ(1, samples->GetCount(10000)); 1346 EXPECT_EQ(1, samples->GetCount(10000));
1347 } 1347 }
OLDNEW
« no previous file with comments | « content/browser/media/session/media_session.cc ('k') | content/common/media/media_metadata_sanitizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698