| 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 "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 ExtensionService* extension_service = | 467 ExtensionService* extension_service = |
| 468 browser()->profile()->GetExtensionService(); | 468 browser()->profile()->GetExtensionService(); |
| 469 | 469 |
| 470 extensions::CrxInstaller* crx_installer = NULL; | 470 extensions::CrxInstaller* crx_installer = NULL; |
| 471 | 471 |
| 472 // Create an observer to wait for the update to finish. | 472 // Create an observer to wait for the update to finish. |
| 473 content::WindowedNotificationObserver windowed_observer( | 473 content::WindowedNotificationObserver windowed_observer( |
| 474 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 474 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 475 content::Source<extensions::CrxInstaller>(crx_installer)); | 475 content::Source<extensions::CrxInstaller>(crx_installer)); |
| 476 ASSERT_TRUE(extension_service-> | 476 ASSERT_TRUE(extension_service-> |
| 477 UpdateExtension(extension->id(), path_v2_, true, GURL(), &crx_installer)); | 477 UpdateExtension(extension->id(), path_v2_, true, &crx_installer)); |
| 478 windowed_observer.Wait(); | 478 windowed_observer.Wait(); |
| 479 | 479 |
| 480 extension = extension_service->GetExtensionById( | 480 extension = extension_service->GetExtensionById( |
| 481 extension_infos[0].id, false); // don't include disabled extensions. | 481 extension_infos[0].id, false); // don't include disabled extensions. |
| 482 | 482 |
| 483 // The total series of events for this process will be: | 483 // The total series of events for this process will be: |
| 484 // Extension Install - install version 1 | 484 // Extension Install - install version 1 |
| 485 // Extension Install - install version 2 | 485 // Extension Install - install version 2 |
| 486 // Extension Update - signal the udate to version 2 | 486 // Extension Update - signal the udate to version 2 |
| 487 // We push back the corresponding ExtensionBasicInfos. | 487 // We push back the corresponding ExtensionBasicInfos. |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 test_server()->GetURL(std::string("files/").append("title2.html"))); | 788 test_server()->GetURL(std::string("files/").append("title2.html"))); |
| 789 | 789 |
| 790 GatherStatistics(); | 790 GatherStatistics(); |
| 791 | 791 |
| 792 metrics = GetStats(METRIC_NETWORK_BYTES_READ); | 792 metrics = GetStats(METRIC_NETWORK_BYTES_READ); |
| 793 ASSERT_EQ(2u, metrics.size()); | 793 ASSERT_EQ(2u, metrics.size()); |
| 794 EXPECT_GE(metrics[1].value, page1_size + page2_size); | 794 EXPECT_GE(metrics[1].value, page1_size + page2_size); |
| 795 } | 795 } |
| 796 | 796 |
| 797 } // namespace performance_monitor | 797 } // namespace performance_monitor |
| OLD | NEW |