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

Unified Diff: chrome/browser/resources/tracing/timeline_model_test.html

Issue 10170001: Find feature for tracing, at long last. (Closed) Base URL: git://localhost/home/nduca/Local/chrome/src@master
Patch Set: patch for landing Created 8 years, 8 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: chrome/browser/resources/tracing/timeline_model_test.html
diff --git a/chrome/browser/resources/tracing/timeline_model_test.html b/chrome/browser/resources/tracing/timeline_model_test.html
index 7b6252025ac99f2cd87c422b15f906d2c8b8ff14..eed12906ff4412357acdfac27c8dcf5662e7dff2 100644
--- a/chrome/browser/resources/tracing/timeline_model_test.html
+++ b/chrome/browser/resources/tracing/timeline_model_test.html
@@ -10,6 +10,7 @@ found in the LICENSE file.
<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js"></script>
<script src="../shared/js/cr.js"></script>
<script src="../shared/js/cr/event_target.js"></script>
+<script src="test_utils.js"></script>
<script src="timeline_model.js"></script>
<script>
goog.require('goog.testing.jsunit');
@@ -25,22 +26,10 @@ var TimelineThreadSlice = tracing.TimelineThreadSlice;
var TimelineProcess = tracing.TimelineProcess;
var TimelineThread = tracing.TimelineThread;
var TimelineModel = tracing.TimelineModel;
+var TimelineFilter = tracing.TimelineFilter;
var TimelineAsyncSlice = tracing.TimelineAsyncSlice;
var TimelineAsyncSliceGroup = tracing.TimelineAsyncSliceGroup;
-
-// Helper function to create a slice.
-function newAsyncSlice(start, duration, startThread, endThread) {
- var s = new TimelineAsyncSlice('a', 0, start);
- s.duration = duration;
- s.startThread = startThread;
- s.endThread = endThread;
- var subSlice = new TimelineAsyncSlice('a', 0, start);
- subSlice.duration = duration;
- subSlice.startThread = startThread;
- subSlice.endThread = endThread;
- s.subSlices = [subSlice];
- return s;
-}
+var newAsyncSlice = test_utils.newAsyncSlice;
function testThreadBounds_Empty() {
var t = new TimelineThread(new TimelineProcess(7), 1);
@@ -248,6 +237,20 @@ function testModelCanImportEmpty() {
m = new TimelineModel([]);
m = new TimelineModel('');
}
+
+function testTimelineFilter() {
+ var s0 = new TimelineSlice('a', 0, 1, {}, 3);
+ assertFalse(new TimelineFilter('').matchSlice(s0));
+
+ assertTrue(new TimelineFilter('a').matchSlice(s0));
+ assertFalse(new TimelineFilter('x').matchSlice(s0));
+
+ var s1 = new TimelineSlice('ba', 0, 1, {}, 3);
+ assertTrue(new TimelineFilter('a').matchSlice(s1));
+ assertTrue(new TimelineFilter('ba').matchSlice(s1));
+ assertFalse(new TimelineFilter('x').matchSlice(s1));
+}
+
</script>
</body>
</html>
« no previous file with comments | « chrome/browser/resources/tracing/timeline_model.js ('k') | chrome/browser/resources/tracing/timeline_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698