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

Unified Diff: chrome/common/chrome_content_client_unittest.cc

Issue 2434103005: Do not replace up-to-date System Flash with Component Flash. (Closed)
Patch Set: Through #10 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | content/public/common/pepper_plugin_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client_unittest.cc
diff --git a/chrome/common/chrome_content_client_unittest.cc b/chrome/common/chrome_content_client_unittest.cc
index 9412f65038a5d4c2b593e334b06b4d8c2a0774a4..6f831d2e41bf25f8b5cb1af6f1e9957fcc31c61f 100644
--- a/chrome/common/chrome_content_client_unittest.cc
+++ b/chrome/common/chrome_content_client_unittest.cc
@@ -143,100 +143,24 @@ TEST(ChromeContentClientTest, FindMostRecent) {
EXPECT_EQ("6.0.0.13", most_recent->version);
// Test real scenarios.
- content::PepperPluginInfo bundled_flash;
- bundled_flash.version = "4.3.2.1";
- bundled_flash.is_external = false;
- bundled_flash.is_debug = false;
- bundled_flash.is_on_local_drive = true;
- bundled_flash.is_bundled = true;
- bundled_flash.name = "bundled_flash";
-
- content::PepperPluginInfo local_component_flash;
- local_component_flash.version = "4.3.2.1";
- local_component_flash.is_external = false;
- local_component_flash.is_debug = false;
- local_component_flash.is_on_local_drive = true;
- local_component_flash.is_bundled = false;
- local_component_flash.name = "local_component_flash";
-
- content::PepperPluginInfo network_component_flash;
- network_component_flash.version = "4.3.2.1";
- network_component_flash.is_external = false;
- network_component_flash.is_debug = false;
- network_component_flash.is_on_local_drive = false;
- network_component_flash.is_bundled = false;
- network_component_flash.name = "network_component_flash";
+ content::PepperPluginInfo component_flash;
+ component_flash.version = "4.3.2.1";
+ component_flash.is_external = false;
+ component_flash.name = "component_flash";
content::PepperPluginInfo system_flash;
system_flash.version = "4.3.2.1";
system_flash.is_external = true;
- system_flash.is_debug = false;
- system_flash.is_on_local_drive = true;
- system_flash.is_bundled = false;
system_flash.name = "system_flash";
- content::PepperPluginInfo system_debug_flash;
- system_debug_flash.version = "4.3.2.1";
- system_debug_flash.is_external = true;
- system_debug_flash.is_debug = true;
- system_debug_flash.is_on_local_drive = false;
- system_debug_flash.is_bundled = false;
- system_debug_flash.name = "system_debug_flash";
-
// The order here should be:
- // 1. Debug System Flash.
- // 2. Bundled.
- // 3. Component update on a local drive.
- // 4. System Flash.
- // 5. Component update on a network drive.
-
- // Debug beats bundled.
- version_vector.clear();
- version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(system_debug_flash));
- version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(bundled_flash));
-
- most_recent = ChromeContentClient::FindMostRecentPlugin(version_vector);
- EXPECT_STREQ("system_debug_flash", most_recent->name.c_str());
-
- // Bundled beats component updated.
+ // 1. System Flash.
+ // 2. Component update.
version_vector.clear();
version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(bundled_flash));
- version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(local_component_flash));
-
- most_recent = ChromeContentClient::FindMostRecentPlugin(version_vector);
- EXPECT_STREQ("bundled_flash", most_recent->name.c_str());
-
- // Bundled beats System flash
- version_vector.clear();
- version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(bundled_flash));
- version_vector.push_back(
base::MakeUnique<content::PepperPluginInfo>(system_flash));
-
- most_recent = ChromeContentClient::FindMostRecentPlugin(version_vector);
- EXPECT_STREQ("bundled_flash", most_recent->name.c_str());
-
- // Local component updated beats System Flash.
- version_vector.clear();
- version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(system_flash));
- version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(local_component_flash));
-
- most_recent = ChromeContentClient::FindMostRecentPlugin(version_vector);
- EXPECT_STREQ("local_component_flash", most_recent->name.c_str());
-
- // System Flash beats component update on network drive.
- version_vector.clear();
version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(network_component_flash));
- version_vector.push_back(
- base::MakeUnique<content::PepperPluginInfo>(system_flash));
-
+ base::MakeUnique<content::PepperPluginInfo>(component_flash));
most_recent = ChromeContentClient::FindMostRecentPlugin(version_vector);
EXPECT_STREQ("system_flash", most_recent->name.c_str());
}
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | content/public/common/pepper_plugin_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698