#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "chrome/browser/extensions/api/gcm/gcm_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_gcm_app_handler.h"
#include "chrome/browser/gcm/gcm_profile_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/gcm_driver/fake_gcm_profile_service.h"
#include "components/sync/base/command_line_switches.h"
#include "content/public/test/browser_test.h"
#include "extensions/test/result_catcher.h"
ResultCatcher;
namespace {
const char kEventsExtension[] = …;
gcm::GCMClient::SendErrorDetails CreateErrorDetails(
const std::string& message_id,
const gcm::GCMClient::Result result,
const std::string& total_messages) { … }
}
namespace extensions {
class GcmApiTest : public ExtensionApiTest { … };
void GcmApiTest::SetUpCommandLine(base::CommandLine* command_line) { … }
void GcmApiTest::SetUpInProcessBrowserTestFixture() { … }
void GcmApiTest::OnWillCreateBrowserContextServices(
content::BrowserContext* context) { … }
void GcmApiTest::StartCollecting() { … }
gcm::FakeGCMProfileService* GcmApiTest::service() const { … }
const Extension* GcmApiTest::LoadTestExtension(
const std::string& extension_path,
const std::string& page_name) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, RegisterValidation) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, Register) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, Unregister) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, SendValidation) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, SendMessageData) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, SendMessageDefaultTTL) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, OnMessagesDeleted) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, OnMessage) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, OnSendError) { … }
IN_PROC_BROWSER_TEST_F(GcmApiTest, Incognito) { … }
}