diff options
author | ckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-04 22:30:11 +0000 |
---|---|---|
committer | ckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-04 22:30:11 +0000 |
commit | 0139a62b7ab43f46a372405d701fd3634a037b31 (patch) | |
tree | 0c659dcc9420d534dcdba8118cc4e0991409b07a /ppapi/tests | |
parent | 465b7a80238d8192081fdcf6fc7e39203cd16c2b (diff) | |
download | chromium_src-0139a62b7ab43f46a372405d701fd3634a037b31.zip chromium_src-0139a62b7ab43f46a372405d701fd3634a037b31.tar.gz chromium_src-0139a62b7ab43f46a372405d701fd3634a037b31.tar.bz2 |
Revert of https://codereview.chromium.org/112663007/
Reason for revert: Broke XP bots: http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%282%29/builds/32520
TBR=yzshen@chromium.org,scheib@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=298339
Review URL: https://codereview.chromium.org/124313005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests')
4 files changed, 0 insertions, 134 deletions
diff --git a/ppapi/tests/extensions/background_keepalive/background.cc b/ppapi/tests/extensions/background_keepalive/background.cc deleted file mode 100644 index 59dd5ef..0000000 --- a/ppapi/tests/extensions/background_keepalive/background.cc +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <cstdio> -#include <string> - -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/message_loop.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/var.h" -#include "ppapi/utility/completion_callback_factory.h" - -class Instance : public pp::Instance { - public: - explicit Instance(PP_Instance instance) : - pp::Instance(instance), - callback_factory_(this), - delay_milliseconds_(10), - active_(true) { - DoSomething(PP_OK); - } - virtual ~Instance() {} - - virtual void HandleMessage(const pp::Var& message_var) { - std::string message_string = message_var.AsString(); - if (message_string == "be idle") { - active_ = false; - } else { - PostMessage("Unhandled control message."); - } - } - - void DoSomething(int32_t result) { - if (active_) { - pp::MessageLoop loop = pp::MessageLoop::GetCurrent(); - pp::CompletionCallback c = callback_factory_.NewCallback( - &Instance::DoSomething); - loop.PostWork(c, delay_milliseconds_); - } - } - - pp::CompletionCallbackFactory<Instance> callback_factory_; - int delay_milliseconds_; - bool active_; -}; - -class Module : public pp::Module { - public: - Module() : pp::Module() {} - virtual ~Module() {} - - virtual pp::Instance* CreateInstance(PP_Instance instance) { - return new Instance(instance); - } -}; - -namespace pp { -Module* CreateModule() { - return new ::Module(); -} -} // namespace pp - diff --git a/ppapi/tests/extensions/background_keepalive/background.js b/ppapi/tests/extensions/background_keepalive/background.js deleted file mode 100644 index 6b9c259..0000000 --- a/ppapi/tests/extensions/background_keepalive/background.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -var NaClModulesExpected = 0; -var NaClModulesLoaded = 0; - -// Indicate load success. -function moduleDidLoad() { - NaClModulesLoaded++; - if (NaClModulesLoaded == NaClModulesExpected) - chrome.test.sendMessage("nacl_modules_loaded", handleChromeTestMessage); -} - -var handleChromeTestMessage = function (message) { - NaClModules = document.querySelectorAll('embed'); - for (var i = 0; i < NaClModules.length; i++) { - NaClModules[i].postMessage(message); - } -} - -function handleNaclMessage(message_event) { - console.log("handleNaclMessage: " + message_event.data); -} - -function createNaClEmbed() { - NaClModulesExpected++; - - var listener = document.createElement("div"); - listener.addEventListener("load", moduleDidLoad, true); - listener.addEventListener("message", handleNaclMessage, true); - listener.innerHTML = '<embed' + - ' src="ppapi_tests_extensions_background_keepalive.nmf"' + - ' type="application/x-nacl" />'; - document.body.appendChild(listener); -} - -// Create 2 embeds to verify that we can handle more than one. -createNaClEmbed(); -createNaClEmbed(); - diff --git a/ppapi/tests/extensions/background_keepalive/manifest.json b/ppapi/tests/extensions/background_keepalive/manifest.json deleted file mode 100644 index 28fb912..0000000 --- a/ppapi/tests/extensions/background_keepalive/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "manifest_version": 2, - "name": "background_nacl", - "version": "0", - "description": "Tests keeping background page with NaCl alive when active.", - "app": { - "background": { - "scripts": ["background.js"] - } - } -} diff --git a/ppapi/tests/extensions/extensions.gyp b/ppapi/tests/extensions/extensions.gyp index 70af268..d063b83f4 100644 --- a/ppapi/tests/extensions/extensions.gyp +++ b/ppapi/tests/extensions/extensions.gyp @@ -29,24 +29,5 @@ ], }, }, - { - 'target_name': 'ppapi_tests_extensions_background_keepalive', - 'type': 'none', - 'variables': { - 'nexe_target': 'ppapi_tests_extensions_background_keepalive', - # Only newlib build is used in tests, no need to build others. - 'build_newlib': 1, - 'build_glibc': 0, - 'build_pnacl_newlib': 0, - 'nexe_destination_dir': 'test_data/ppapi/tests/extensions/background_keepalive', - 'sources': [ - 'background_keepalive/background.cc', - ], - 'test_files': [ - 'background_keepalive/background.js', - 'background_keepalive/manifest.json', - ], - }, - }, ], } |