OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 g_perfMon.onRender(renderEvent.elapsedTime); | 1827 g_perfMon.onRender(renderEvent.elapsedTime); |
1828 } | 1828 } |
1829 } | 1829 } |
1830 | 1830 |
1831 function onAllLoadingFinished() { | 1831 function onAllLoadingFinished() { |
1832 g_loader = null; | 1832 g_loader = null; |
1833 g_animateCamera = true; | 1833 g_animateCamera = true; |
1834 | 1834 |
1835 showHint(); | 1835 showHint(); |
1836 | 1836 |
| 1837 window.o3d_prepForSelenium = prepForSelenium; |
1837 window.g_finished = true; // for selenium testing. | 1838 window.g_finished = true; // for selenium testing. |
1838 } | 1839 } |
1839 | 1840 |
| 1841 // Put the demo in a consistent state. |
| 1842 function prepForSelenium() { |
| 1843 // Turn off the perf monitor. |
| 1844 g_perfMon = null; |
| 1845 |
| 1846 // Set the render targets to a fixed size. |
| 1847 g_renderTargetWidth = 256; |
| 1848 g_renderTargetHeight = 256; |
| 1849 setupRenderTargets(); |
| 1850 } |
| 1851 |
1840 /** | 1852 /** |
1841 * Creates the client area. | 1853 * Creates the client area. |
1842 */ | 1854 */ |
1843 function init() { | 1855 function init() { |
1844 // These are here so they are shared by both V8 and the browser. | 1856 // These are here so they are shared by both V8 and the browser. |
1845 window.g_finished = false; // for selenium | 1857 window.g_finished = false; // for selenium |
1846 window.g_timeMult = 1; | 1858 window.g_timeMult = 1; |
1847 window.g_clock = 0; | 1859 window.g_clock = 0; |
1848 | 1860 |
1849 // Comment out the line below to run the sample in the browser JavaScript | 1861 // Comment out the line below to run the sample in the browser JavaScript |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 | 2738 |
2727 /** | 2739 /** |
2728 * Removes any callbacks so they don't get called after the page has unloaded. | 2740 * Removes any callbacks so they don't get called after the page has unloaded. |
2729 */ | 2741 */ |
2730 function uninit() { | 2742 function uninit() { |
2731 if (g_client) { | 2743 if (g_client) { |
2732 g_client.cleanup(); | 2744 g_client.cleanup(); |
2733 } | 2745 } |
2734 } | 2746 } |
2735 | 2747 |
OLD | NEW |