Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / chrome / test / ispy / client / wait_on_ajax.js
blobda1fce9c664ef61e09a084625c7d0687eeddfe34
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.
5 var target = document.body;
6 var callback = arguments[arguments.length - 1]
8 var timeout_id = setTimeout(function() {
9 callback()
10 }, 5000);
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});