Bug 1189901: part 1: remove code redundancy between tscrollx and tp5o_scroll. r=jmaher

This commit is contained in:
Avi Halachmi 2016-09-27 16:43:36 +03:00
Родитель f84225ca51
Коммит cc4bbce3d9
7 изменённых файлов: 16 добавлений и 18 удалений

Просмотреть файл

@ -1,9 +1,6 @@
// Note: The content from here upto '// End scroll test' is duplicated at:
// - talos/tests/scroll/scroll-test.js
// - inside talos/pageloader/chrome/tscroll.js
//
// - Please keep these copies in sync.
// - Pleace make sure that any changes apply cleanly to all use cases.
// Note: This file is used at both tscrollx and tp5o_scroll. With the former as
// unprivileged code.
// - Please make sure that any changes apply cleanly to all use cases.
function testScroll(target, stepSize, opt_reportFunc, opt_numSteps)
{
@ -121,12 +118,13 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps)
rAF(startTest);
}, 260);
}
// End scroll test - End duplicated code
// This code below here is unique to tscroll.js inside of pageloader
function handleMessageFromChrome(message) {
try {
function handleMessageFromChrome(message) {
var payload = message.data.details;
testScroll(payload.target, payload.stepSize, 'PageLoader:RecordTime', payload.opt_numSteps);
}
}
addMessageListener("PageLoader:ScrollTest", handleMessageFromChrome);
addMessageListener("PageLoader:ScrollTest", handleMessageFromChrome);
} catch (e) {}

Просмотреть файл

@ -35,5 +35,5 @@
<!-- this has to come after the iframe for some reason -->
<script type="text/javascript" xlink:href="../../scripts/talos-debug.js"/>
<script type="text/javascript" xlink:href="../../scripts/Profiler.js"/>
<script type="text/javascript" xlink:href="scroll-test.js"/>
<script type="text/javascript" xlink:href="../../pageloader/chrome/tscroll.js"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Просмотреть файл

@ -4,7 +4,7 @@
<title>Perf test case</title>
<link type="text/css" rel="stylesheet" href="reader.css">
<script src="../../scripts/Profiler.js" type="text/javascript"></script>
<script src="scroll-test.js" type="text/javascript"></script>
<script src="../../pageloader/chrome/tscroll.js" type="text/javascript"></script>
<!--
This resembles the layout of Google Reader as of 2009-11-23
and exposed bug 530686.

Просмотреть файл

@ -9,7 +9,7 @@
}
</style>
<script src="../../scripts/Profiler.js" type="text/javascript"></script>
<script src="scroll-test.js" type="text/javascript"></script>
<script src="../../pageloader/chrome/tscroll.js" type="text/javascript"></script>
</head>
<body onload = "testScroll(window, 5)">
<P>

Просмотреть файл

@ -10,7 +10,7 @@
}
</style>
<script src="../../scripts/Profiler.js" type="text/javascript"></script>
<script src="scroll-test.js" type="text/javascript"></script>
<script src="../../pageloader/chrome/tscroll.js" type="text/javascript"></script>
</head>
<body onload = "testScroll(window, 5)">
<P>

Просмотреть файл

@ -7,7 +7,7 @@
}
</style>
<script src="../../scripts/Profiler.js" type="text/javascript"></script>
<script src="scroll-test.js" type="text/javascript"></script>
<script src="../../pageloader/chrome/tscroll.js" type="text/javascript"></script>
</head>
<body onload = "testScroll(window, 5)">
<P>

Просмотреть файл

@ -6,7 +6,7 @@
}
</style>
<script src="../../scripts/Profiler.js" type="text/javascript"></script>
<script src="scroll-test.js" type="text/javascript"></script>
<script src="../../pageloader/chrome/tscroll.js" type="text/javascript"></script>
</head>
<body onload = "testScroll(window, 5)">
<P>