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

Side by Side Diff: Source/core/html/TimeRangesTest.cpp

Issue 61603006: Remove MediaSourcePrivate/SourceBufferPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: assert null Created 7 years, 1 month 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
« no previous file with comments | « Source/core/html/TimeRanges.cpp ('k') | Source/core/platform/graphics/MediaSourcePrivate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 TEST(TimeRanges, Empty) 54 TEST(TimeRanges, Empty)
55 { 55 {
56 ASSERT_RANGE("{ }", TimeRanges::create()); 56 ASSERT_RANGE("{ }", TimeRanges::create());
57 } 57 }
58 58
59 TEST(TimeRanges, SingleRange) 59 TEST(TimeRanges, SingleRange)
60 { 60 {
61 ASSERT_RANGE("{ [1,2) }", TimeRanges::create(1, 2)); 61 ASSERT_RANGE("{ [1,2) }", TimeRanges::create(1, 2));
62 } 62 }
63 63
64 TEST(TimeRanges, CreateFromWebTimeRanges)
65 {
66 blink::WebTimeRanges webRanges(static_cast<size_t>(2));
67 webRanges[0].start = 0;
68 webRanges[0].end = 1;
69 webRanges[1].start = 2;
70 webRanges[1].end = 3;
71 ASSERT_RANGE("{ [0,1) [2,3) }", TimeRanges::create(webRanges));
72 }
73
64 TEST(TimeRanges, AddOrder) 74 TEST(TimeRanges, AddOrder)
65 { 75 {
66 RefPtr<TimeRanges> rangeA = TimeRanges::create(); 76 RefPtr<TimeRanges> rangeA = TimeRanges::create();
67 RefPtr<TimeRanges> rangeB = TimeRanges::create(); 77 RefPtr<TimeRanges> rangeB = TimeRanges::create();
68 78
69 rangeA->add(0, 2); 79 rangeA->add(0, 2);
70 rangeA->add(3, 4); 80 rangeA->add(3, 4);
71 rangeA->add(5, 100); 81 rangeA->add(5, 100);
72 82
73 std::string expected = "{ [0,2) [3,4) [5,100) }"; 83 std::string expected = "{ [0,2) [3,4) [5,100) }";
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 rangesB->add(6, 9); 291 rangesB->add(6, 9);
282 292
283 ASSERT_RANGE("{ [0,2) [4,7) [8,10) }", rangesA); 293 ASSERT_RANGE("{ [0,2) [4,7) [8,10) }", rangesA);
284 ASSERT_RANGE("{ [1,5) [6,9) }", rangesB); 294 ASSERT_RANGE("{ [1,5) [6,9) }", rangesB);
285 295
286 rangesA->intersectWith(rangesB.get()); 296 rangesA->intersectWith(rangesB.get());
287 297
288 ASSERT_RANGE("{ [1,2) [4,5) [6,7) [8,9) }", rangesA); 298 ASSERT_RANGE("{ [1,2) [4,5) [6,7) [8,9) }", rangesA);
289 ASSERT_RANGE("{ [1,5) [6,9) }", rangesB); 299 ASSERT_RANGE("{ [1,5) [6,9) }", rangesB);
290 } 300 }
OLDNEW
« no previous file with comments | « Source/core/html/TimeRanges.cpp ('k') | Source/core/platform/graphics/MediaSourcePrivate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698