Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Issue 128433005: Revert of Test Keeping NaCl plugins used in app background pages alive when active. (Closed)

Created:
6 years, 11 months ago by Noam Samuel
Modified:
6 years, 11 months ago
Reviewers:
scheib, yzshen1
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Visibility:
Public.

Description

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -327 lines) Patch
M chrome/browser/extensions/DEPS View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/extensions/app_background_page_apitest.cc View 5 chunks +0 lines, -134 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -2 lines 0 comments Download
M components/nacl/browser/nacl_process_host.cc View 1 chunk +1 line, -5 lines 0 comments Download
M extensions/browser/process_manager.h View 2 chunks +0 lines, -11 lines 0 comments Download
M extensions/browser/process_manager.cc View 3 chunks +1 line, -17 lines 0 comments Download
M ppapi/proxy/plugin_main_nacl.cc View 5 chunks +0 lines, -17 lines 0 comments Download
M ppapi/shared_impl/ppapi_switches.h View 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/shared_impl/ppapi_switches.cc View 1 chunk +0 lines, -3 lines 0 comments Download
D ppapi/tests/extensions/background_keepalive/background.cc View 1 chunk +0 lines, -63 lines 0 comments Download
D ppapi/tests/extensions/background_keepalive/background.js View 1 chunk +0 lines, -41 lines 0 comments Download
D ppapi/tests/extensions/background_keepalive/manifest.json View 1 chunk +0 lines, -11 lines 0 comments Download
M ppapi/tests/extensions/extensions.gyp View 1 chunk +0 lines, -19 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Noam Samuel
Created Revert of Test Keeping NaCl plugins used in app background pages alive when active.
6 years, 11 months ago (2014-01-08 18:50:13 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noamsml@chromium.org/128433005/1
6 years, 11 months ago (2014-01-08 18:52:44 UTC) #2
commit-bot: I haz the power
6 years, 11 months ago (2014-01-08 18:52:49 UTC) #3
Failed to apply patch for
chrome/browser/extensions/app_background_page_apitest.cc:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file chrome/browser/extensions/app_background_page_apitest.cc
  Hunk #5 FAILED at 503.
  1 out of 5 hunks FAILED -- saving rejects to file
chrome/browser/extensions/app_background_page_apitest.cc.rej

Patch:       chrome/browser/extensions/app_background_page_apitest.cc
Index: chrome/browser/extensions/app_background_page_apitest.cc
diff --git a/chrome/browser/extensions/app_background_page_apitest.cc
b/chrome/browser/extensions/app_background_page_apitest.cc
index
c221f4f569233fd5f7801ce982f61c2c468f1bd2..90db425dd3b4ba8648498fe9114bf4bcdb4d0cde
100644
--- a/chrome/browser/extensions/app_background_page_apitest.cc
+++ b/chrome/browser/extensions/app_background_page_apitest.cc
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/path_service.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/background/background_contents_service.h"
@@ -12,13 +11,10 @@
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/extension_test_message_listener.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/browser_dialogs.h"
 #include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/extensions/application_launch.h"
-#include "chrome/common/chrome_paths.h"
 #include "chrome/common/chrome_switches.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/test/test_notification_tracker.h"
@@ -27,7 +23,6 @@
 #include "extensions/common/switches.h"
 #include "net/dns/mock_host_resolver.h"
 #include "net/test/embedded_test_server/embedded_test_server.h"
-#include "ppapi/shared_impl/ppapi_switches.h"
 
 #if defined(OS_MACOSX)
 #include "base/mac/scoped_nsautorelease_pool.h"
@@ -114,88 +109,6 @@
   base::ScopedTempDir app_dir_;
 };
 
-namespace {
-
-// Fixture to assist in testing v2 app background pages containing
-// Native Client embeds.
-class AppBackgroundPageNaClTest : public AppBackgroundPageApiTest {
- public:
-  AppBackgroundPageNaClTest()
-      : extension_(NULL) {
-    PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_);
-    app_dir_ = app_dir_.AppendASCII(
-        "ppapi/tests/extensions/background_keepalive/newlib");
-  }
-  virtual ~AppBackgroundPageNaClTest() {
-  }
-
-  virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
-    AppBackgroundPageApiTest::SetUpCommandLine(command_line);
-    command_line->AppendSwitchASCII(
-        switches::kPpapiKeepAliveThrottle, "50");
-    command_line->AppendSwitchASCII(
-        extensions::switches::kEventPageIdleTime, "1000");
-    command_line->AppendSwitchASCII(
-        extensions::switches::kEventPageSuspendingTime, "1000");
-  }
-
-  const Extension* extension() { return extension_; }
-
- protected:
-  void LaunchTestingApp() {
-    extension_ = LoadExtension(app_dir_);
-    ASSERT_TRUE(extension_);
-  }
-
- private:
-  base::FilePath app_dir_;
-  const Extension* extension_;
-};
-
-// Produces an extensions::ProcessManager::ImpulseCallbackForTesting callback
-// that will match a specified goal and can be waited on.
-class ImpulseCallbackCounter {
- public:
-  explicit ImpulseCallbackCounter(const std::string& extension_id)
-      : observed_(0),
-        goal_(0),
-        extension_id_(extension_id) {
-  }
-
-  extensions::ProcessManager::ImpulseCallbackForTesting
-      SetGoalAndGetCallback(int goal) {
-    observed_ = 0;
-    goal_ = goal;
-    message_loop_runner_ = new content::MessageLoopRunner();
-    return base::Bind(&ImpulseCallbackCounter::ImpulseCallback,
-                      base::Unretained(this),
-                      message_loop_runner_->QuitClosure(),
-                      extension_id_);
-  }
-
-  void Wait() {
-    message_loop_runner_->Run();
-  }
- private:
-  void ImpulseCallback(
-      const base::Closure& quit_callback,
-      const std::string& extension_id_from_test,
-      const std::string& extension_id_from_manager) {
-    if (extension_id_from_test == extension_id_from_manager) {
-      if (++observed_ >= goal_) {
-        quit_callback.Run();
-      }
-    }
-  }
-
-  int observed_;
-  int goal_;
-  const std::string extension_id_;
-  scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
-};
-
-}  // namespace
-
 // Disable on Mac only.  http://crbug.com/95139
 #if defined(OS_MACOSX)
 #define MAYBE_Basic DISABLED_Basic
@@ -590,50 +503,3 @@
   content::RunAllPendingInMessageLoop();
   ASSERT_TRUE(WaitForBackgroundMode(false));
 }
-
-// Verify active NaCl embeds cause many keepalive impulses to be sent.
-IN_PROC_BROWSER_TEST_F(AppBackgroundPageNaClTest, BackgroundKeepaliveActive) {
-  ExtensionTestMessageListener nacl_modules_loaded("nacl_modules_loaded",
true);
-  LaunchTestingApp();
-  extensions::ProcessManager* manager =
-    extensions::ExtensionSystem::Get(browser()->profile())->process_manager();
-  ImpulseCallbackCounter active_impulse_counter(extension()->id());
-  EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied());
-
-  // Target .5 seconds: .5 seconds / 50ms throttle * 2 embeds == 20 impulses.
-  manager->SetKeepaliveImpulseCallbackForTesting(
-      active_impulse_counter.SetGoalAndGetCallback(20));
-  active_impulse_counter.Wait();
-
-  // Clear callback to free reference to message loop in
ImpulseCallbackCounter.
-  manager->SetKeepaliveImpulseCallbackForTesting(
-      extensions::ProcessManager::ImpulseCallbackForTesting());
-}
-
-// Verify that nacl modules that go idle will not send keepalive impulses.
-// Disabled on windows due to Win XP failures:
-// DesktopRootWindowHostWin::HandleCreate not implemented. crbug.com/331954
-#if defined(OS_WIN)
-#define MAYBE_BackgroundKeepaliveIdle DISABLED_BackgroundKeepaliveIdle
-#else
-#define MAYBE_BackgroundKeepaliveIdle BackgroundKeepaliveIdle
-#endif
-IN_PROC_BROWSER_TEST_F(AppBackgroundPageNaClTest,
-                       MAYBE_BackgroundKeepaliveIdle) {
-  ExtensionTestMessageListener nacl_modules_loaded("nacl_modules_loaded",
true);
-  LaunchTestingApp();
-  extensions::ProcessManager* manager =
-    extensions::ExtensionSystem::Get(browser()->profile())->process_manager();
-  ImpulseCallbackCounter idle_impulse_counter(extension()->id());
-  EXPECT_TRUE(nacl_modules_loaded.WaitUntilSatisfied());
-
-  manager->SetKeepaliveImpulseDecrementCallbackForTesting(
-      idle_impulse_counter.SetGoalAndGetCallback(1));
-  nacl_modules_loaded.Reply("be idle");
-  idle_impulse_counter.Wait();
-
-  // Clear callback to free reference to message loop in
ImpulseCallbackCounter.
-  manager->SetKeepaliveImpulseDecrementCallbackForTesting(
-      extensions::ProcessManager::ImpulseCallbackForTesting());
-}
-

Powered by Google App Engine
This is Rietveld 408576698