 Chromium Code Reviews
 Chromium Code Reviews Issue 1267183003:
  Hide requests in an extension from other extensions  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1267183003:
  Hide requests in an extension from other extensions  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" | 
| 6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" | 
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" | 
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" | 
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" | 
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" | 
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 // Reload extension and wait for rules to be set up again. This should not | 315 // Reload extension and wait for rules to be set up again. This should not | 
| 316 // crash the browser. | 316 // crash the browser. | 
| 317 ExtensionTestMessageListener listener2("done", true); | 317 ExtensionTestMessageListener listener2("done", true); | 
| 318 ExtensionTestMessageListener listener_incognito2("done_incognito", true); | 318 ExtensionTestMessageListener listener_incognito2("done_incognito", true); | 
| 319 | 319 | 
| 320 ReloadExtension(extension->id()); | 320 ReloadExtension(extension->id()); | 
| 321 | 321 | 
| 322 EXPECT_TRUE(listener2.WaitUntilSatisfied()); | 322 EXPECT_TRUE(listener2.WaitUntilSatisfied()); | 
| 323 EXPECT_TRUE(listener_incognito2.WaitUntilSatisfied()); | 323 EXPECT_TRUE(listener_incognito2.WaitUntilSatisfied()); | 
| 324 } | 324 } | 
| 325 | |
| 326 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, ExtensionRequests) { | |
| 327 ASSERT_TRUE(StartEmbeddedTestServer()); | |
| 328 ExtensionTestMessageListener listener_main("webRequestListening", true); | |
| 329 ExtensionTestMessageListener listener_app("app_done", false); | |
| 330 ExtensionTestMessageListener listener_extension("extension_done", false); | |
| 
not at google - send to devlin
2015/08/04 20:27:02
could you standardise on camelcase vs underscores?
 
robwu
2015/08/04 21:57:24
Done.
 | |
| 331 | |
| 332 // Set up webRequest listener | |
| 333 ASSERT_TRUE(LoadExtension( | |
| 334 test_data_dir_.AppendASCII("webrequest_extensions/main"))); | |
| 335 EXPECT_TRUE(listener_main.WaitUntilSatisfied()); | |
| 336 | |
| 337 // Perform some network activity in an app and another extension. | |
| 
not at google - send to devlin
2015/08/04 20:27:02
1. The app and extension do slightly different thi
 
robwu
2015/08/04 21:57:24
Good point, done.
 | |
| 338 ASSERT_TRUE(LoadExtension( | |
| 339 test_data_dir_.AppendASCII("webrequest_extensions/app"))); | |
| 340 ASSERT_TRUE(LoadExtension( | |
| 341 test_data_dir_.AppendASCII("webrequest_extensions/extension"))); | |
| 342 | |
| 343 EXPECT_TRUE(listener_app.WaitUntilSatisfied()); | |
| 344 EXPECT_TRUE(listener_extension.WaitUntilSatisfied()); | |
| 345 | |
| 346 // Collect result. | |
| 347 ExtensionTestMessageListener listener_done(false); | |
| 348 listener_main.Reply(""); | |
| 349 EXPECT_TRUE(listener_done.WaitUntilSatisfied()); | |
| 350 | |
| 351 EXPECT_EQ("OK", listener_done.message()); | |
| 352 } | |
| OLD | NEW |