- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / functional / ispy / client / wait_on_ajax.js
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var target = document.body;
6 var callback = arguments[arguments.length - 1]
7
8 var timeout_id = setTimeout(function() {
9   callback()
10 }, 5000);
11
12 var observer = new MutationObserver(function(mutations) {
13   clearTimeout(timeout_id);
14   timeout_id = setTimeout(function() {
15     callback();
16   }, 5000);
17 }).observe(target, {attributes: true, childList: true,
18   characterData: true, subtree: true});